------------------------------------------------------------ revno: 117250 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-06-03 12:59:55 -0700 message: Do not require libXt-devel when building with gtk. * lwlib/lwlib-widget.h: New file, with contents taken from lwlib.h. (widget_value) [HAVE_NTGUI]: New member 'title'. * lwlib/lwlib.h: Include lwlib-widget.h. (change_type, enum button_type, widget_value): Move to lwlib-widget.h. * src/gtkutil.h, src/menu.h: Include lwlib-widget.h, not lwlib-h, to avoid dependency on libXt-devel. * src/menu.h [HAVE_NTGUI]: Include lwlib-widget.h in this case too. (enum button_type, widget_value) [HAVE_NTGUI]: Remove, as lwlib-widget.h now does this. * src/nsmenu.m (ns_menu_show): "enabled" -> "enable" to fix typo. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2014-06-03 04:17:53 +0000 +++ lwlib/ChangeLog 2014-06-03 19:59:55 +0000 @@ -1,3 +1,12 @@ +2014-06-03 Paul Eggert + + Do not require libXt-devel when building with gtk. + * lwlib-widget.h: New file, with contents taken from lwlib.h. + (widget_value) [HAVE_NTGUI]: New member 'title'. + * lwlib.h: Include lwlib-widget.h. + (change_type, enum button_type, widget_value): + Move to lwlib-widget.h. + 2014-06-03 Dmitry Antipov * xlwmenu.c (openXftFont): Do not load regular X font here. === added file 'lwlib/lwlib-widget.h' --- lwlib/lwlib-widget.h 1970-01-01 00:00:00 +0000 +++ lwlib/lwlib-widget.h 2014-06-03 19:59:55 +0000 @@ -0,0 +1,100 @@ +/* +Copyright (C) 1992, 1993 Lucid, Inc. +Copyright (C) 1994, 1999-2014 Free Software Foundation, Inc. + +This file is part of the Lucid Widget Library. + +The Lucid Widget Library is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 1, or (at your option) +any later version. + +The Lucid Widget Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +/* This part is separate from lwlib.h because it does not need X, + and thus can be used by non-X code in Emacs proper. */ + +#ifndef LWLIB_WIDGET_H +#define LWLIB_WIDGET_H + +typedef enum +{ + NO_CHANGE = 0, + INVISIBLE_CHANGE = 1, + VISIBLE_CHANGE = 2, + STRUCTURAL_CHANGE = 3 +} change_type; + +enum button_type +{ + BUTTON_TYPE_NONE, + BUTTON_TYPE_TOGGLE, + BUTTON_TYPE_RADIO +}; + +typedef struct _widget_value +{ + /* Name of widget. */ + Lisp_Object lname; + char *name; + + /* Value (meaning depend on widget type). */ + char *value; + + /* Keyboard equivalent. no implications for XtTranslations. */ + Lisp_Object lkey; + char *key; + + /* Help string or nil if none. + GC finds this string through the frame's menu_bar_vector + or through menu_items. */ + Lisp_Object help; + + /* True if enabled. */ + bool enabled; + + /* True if selected. */ + bool selected; + + /* True if was edited (maintained by get_value). */ + bool edited; + +#ifdef HAVE_NTGUI + /* True if menu title. */ + bool title; +#endif + + /* The type of a button. */ + enum button_type button_type; + + /* Type of change (maintained by lw library). */ + change_type change; + + /* Type of this widget's change, but not counting the other widgets + found in the `next' field. */ + change_type this_one_change; + + /* Contents of the sub-widgets, also selected slot for checkbox. */ + struct _widget_value *contents; + + /* Data passed to callback. */ + void *call_data; + + /* Next one in the list. */ + struct _widget_value *next; + + /* Slot for the toolkit dependent part. Always initialize to NULL. */ + void *toolkit_data; + + /* Whether we should free the toolkit data slot when freeing the + widget_value itself. */ + bool free_toolkit_data; +} widget_value; + +#endif === modified file 'lwlib/lwlib.h' --- lwlib/lwlib.h 2014-06-02 18:01:21 +0000 +++ lwlib/lwlib.h 2014-06-03 19:59:55 +0000 @@ -42,23 +42,10 @@ ** main: ("name") */ +#include "lwlib-widget.h" + typedef unsigned long LWLIB_ID; -typedef enum _change_type -{ - NO_CHANGE = 0, - INVISIBLE_CHANGE = 1, - VISIBLE_CHANGE = 2, - STRUCTURAL_CHANGE = 3 -} change_type; - -enum button_type -{ - BUTTON_TYPE_NONE, - BUTTON_TYPE_TOGGLE, - BUTTON_TYPE_RADIO -}; - /* Menu separator types. */ enum menu_separator @@ -81,46 +68,6 @@ SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH }; -typedef struct _widget_value -{ - /* name of widget */ - Lisp_Object lname; - char* name; - /* value (meaning depend on widget type) */ - char* value; - /* keyboard equivalent. no implications for XtTranslations */ - Lisp_Object lkey; - char* key; - /* Help string or nil if none. - GC finds this string through the frame's menu_bar_vector - or through menu_items. */ - Lisp_Object help; - /* true if enabled */ - Boolean enabled; - /* true if selected */ - Boolean selected; - /* true if was edited (maintained by get_value) */ - Boolean edited; - /* The type of a button. */ - enum button_type button_type; - /* true if has changed (maintained by lw library) */ - change_type change; - /* true if this widget itself has changed, - but not counting the other widgets found in the `next' field. */ - change_type this_one_change; - /* Contents of the sub-widgets, also selected slot for checkbox */ - struct _widget_value* contents; - /* data passed to callback */ - XtPointer call_data; - /* next one in the list */ - struct _widget_value* next; - /* slot for the toolkit dependent part. Always initialize to NULL. */ - void* toolkit_data; - /* tell us if we should free the toolkit data slot when freeing the - widget_value itself. */ - Boolean free_toolkit_data; -} widget_value; - typedef void (*lw_callback) (Widget w, LWLIB_ID id, void* data); === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-03 16:15:43 +0000 +++ src/ChangeLog 2014-06-03 19:59:55 +0000 @@ -1,3 +1,13 @@ +2014-06-03 Paul Eggert + + Do not require libXt-devel when building with gtk. + * gtkutil.h, menu.h: Include lwlib-widget.h, not lwlib-h, to avoid + dependency on libXt-devel. + * menu.h [HAVE_NTGUI]: Include lwlib-widget.h in this case too. + (enum button_type, widget_value) [HAVE_NTGUI]: Remove, as + lwlib-widget.h now does this. + * nsmenu.m (ns_menu_show): "enabled" -> "enable" to fix typo. + 2014-06-03 Paul Eggert If ENABLE_CHECKING, range-check args of FD_CLR, FD_ISSET, FD_SET. === modified file 'src/gtkutil.h' --- src/gtkutil.h 2014-06-02 18:01:21 +0000 +++ src/gtkutil.h 2014-06-03 19:59:55 +0000 @@ -24,7 +24,7 @@ #ifdef USE_GTK #include -#include "../lwlib/lwlib.h" +#include "../lwlib/lwlib-widget.h" #include "frame.h" #include "xterm.h" === modified file 'src/menu.h' --- src/menu.h 2014-06-03 06:51:18 +0000 +++ src/menu.h 2014-06-03 19:59:55 +0000 @@ -20,52 +20,9 @@ #define MENU_H #include "systime.h" /* for Time */ -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) -#include "../lwlib/lwlib.h" /* for widget_value */ -#endif +#include "../lwlib/lwlib-widget.h" #ifdef HAVE_NTGUI -/* This is based on the one in ../lwlib/lwlib.h, with unused portions - removed. HAVE_NTGUI cannot include lwlib.h, as that pulls in X11 - headers. */ - -enum button_type -{ - BUTTON_TYPE_NONE, - BUTTON_TYPE_TOGGLE, - BUTTON_TYPE_RADIO -}; - -typedef struct _widget_value -{ - /* name of widget */ - Lisp_Object lname; - const char* name; - /* value (meaning depend on widget type) */ - const char* value; - /* keyboard equivalent. no implications for XtTranslations */ - Lisp_Object lkey; - const char* key; - /* Help string or nil if none. - GC finds this string through the frame's menu_bar_vector - or through menu_items. */ - Lisp_Object help; - /* true if enabled */ - unsigned char enabled; - /* true if selected */ - unsigned char selected; - /* The type of a button. */ - enum button_type button_type; - /* true if menu title */ - unsigned char title; - /* Contents of the sub-widgets, also selected slot for checkbox */ - struct _widget_value* contents; - /* data passed to callback */ - void *call_data; - /* next one in the list */ - struct _widget_value* next; -} widget_value; - extern Lisp_Object Qunsupported__w32_dialog; #endif === modified file 'src/nsmenu.m' --- src/nsmenu.m 2014-06-02 18:01:21 +0000 +++ src/nsmenu.m 2014-06-03 19:59:55 +0000 @@ -943,7 +943,7 @@ } #endif /* not HAVE_MULTILINGUAL_MENU */ - wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enabled), + wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable), STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; ------------------------------------------------------------ revno: 117249 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-06-03 09:15:43 -0700 message: If ENABLE_CHECKING, range-check args of FD_CLR, FD_ISSET, FD_SET. * process.c (add_read_fd, delete_read_fd, add_write_fd) (delete_write_fd, wait_reading_process_output): Remove now-redundant easserts. * sysselect.h (SYSSELECT_H): New macro, to avoid double-inclusion woes. Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. (fd_CLR, fd_ISSET, fd_SET): New inline functions. (FD_CLR, FD_ISSET, FD_SET): Redefine in terms of these functions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-03 10:01:08 +0000 +++ src/ChangeLog 2014-06-03 16:15:43 +0000 @@ -1,3 +1,14 @@ +2014-06-03 Paul Eggert + + If ENABLE_CHECKING, range-check args of FD_CLR, FD_ISSET, FD_SET. + * process.c (add_read_fd, delete_read_fd, add_write_fd) + (delete_write_fd, wait_reading_process_output): + Remove now-redundant easserts. + * sysselect.h (SYSSELECT_H): New macro, to avoid double-inclusion woes. + Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. + (fd_CLR, fd_ISSET, fd_SET): New inline functions. + (FD_CLR, FD_ISSET, FD_SET): Redefine in terms of these functions. + 2014-06-03 Eli Zaretskii * w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use === modified file 'src/process.c' --- src/process.c 2014-06-03 00:44:30 +0000 +++ src/process.c 2014-06-03 16:15:43 +0000 @@ -468,7 +468,6 @@ void add_read_fd (int fd, fd_callback func, void *data) { - eassert (fd < FD_SETSIZE); add_keyboard_wait_descriptor (fd); fd_callback_info[fd].func = func; @@ -481,7 +480,6 @@ void delete_read_fd (int fd) { - eassert (fd < FD_SETSIZE); delete_keyboard_wait_descriptor (fd); fd_callback_info[fd].condition &= ~FOR_READ; @@ -498,7 +496,6 @@ void add_write_fd (int fd, fd_callback func, void *data) { - eassert (fd < FD_SETSIZE); FD_SET (fd, &write_mask); if (fd > max_input_desc) max_input_desc = fd; @@ -529,7 +526,6 @@ void delete_write_fd (int fd) { - eassert (fd < FD_SETSIZE); FD_CLR (fd, &write_mask); fd_callback_info[fd].condition &= ~FOR_WRITE; if (fd_callback_info[fd].condition == 0) @@ -4652,8 +4648,6 @@ > 0)) { nfds = 1; - eassert (0 <= wait_proc->infd - && wait_proc->infd < FD_SETSIZE); /* Set to Available. */ FD_SET (wait_proc->infd, &Available); } === modified file 'src/sysselect.h' --- src/sysselect.h 2014-01-01 07:43:34 +0000 +++ src/sysselect.h 2014-06-03 16:15:43 +0000 @@ -16,6 +16,9 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#ifndef SYSSELECT_H +#define SYSSELECT_H 1 + #ifndef DOS_NT #include #endif @@ -47,3 +50,39 @@ #ifdef MSDOS #define pselect sys_select #endif + +INLINE_HEADER_BEGIN + +/* Check for out-of-range errors if ENABLE_CHECKING is defined. */ + +INLINE void +fd_CLR (int fd, fd_set *set) +{ + eassume (0 <= fd && fd < FD_SETSIZE); + FD_CLR (fd, set); +} + +INLINE bool +fd_ISSET (int fd, fd_set *set) +{ + eassume (0 <= fd && fd < FD_SETSIZE); + return FD_ISSET (fd, set) != 0; +} + +INLINE void +fd_SET (int fd, fd_set *set) +{ + eassume (0 <= fd && fd < FD_SETSIZE); + FD_SET (fd, set); +} + +#undef FD_CLR +#undef FD_ISSET +#undef FD_SET +#define FD_CLR(fd, set) fd_CLR (fd, set) +#define FD_ISSET(fd, set) fd_ISSET (fd, set) +#define FD_SET(fd, set) fd_SET (fd, set) + +INLINE_HEADER_END + +#endif ------------------------------------------------------------ revno: 117248 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-06-03 13:01:08 +0300 message: More minor cleanups in src/w32heap.c. src/w32heap.c (calloc): Don't undef, it is never defined. (HEAP_ENTRY_SHIFT): Remove unused macro. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-03 07:28:07 +0000 +++ src/ChangeLog 2014-06-03 10:01:08 +0000 @@ -3,6 +3,8 @@ * w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use HEAPSIZE; instead, define separate values for the 32- and 64-bit builds. + (calloc): Don't undef, it is never defined. + (HEAP_ENTRY_SHIFT): Remove unused macro. * Makefile.in (C_HEAP_SWITCH): Remove. (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH). === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-03 07:28:07 +0000 +++ src/w32heap.c 2014-06-03 10:01:08 +0000 @@ -122,9 +122,7 @@ static unsigned char dumped_data[DUMPED_HEAP_SIZE]; -/* Info for managing our preload heap, which is essentially a fixed size - data area in the executable. */ -/* Info for keeping track of our heap. */ +/* Info for keeping track of our dynamic heap used after dumping. */ unsigned char *data_region_base = NULL; unsigned char *data_region_end = NULL; static DWORD_PTR committed = 0; @@ -155,7 +153,9 @@ + committed */ -#define HEAP_ENTRY_SHIFT 3 + +/* Info for managing our preload heap, which is essentially a fixed size + data area in the executable. */ #define PAGE_SIZE 0x1000 #define MaxBlockSize (0x80000 - PAGE_SIZE) @@ -296,7 +296,6 @@ #undef malloc #undef realloc -#undef calloc #undef free /* FREEABLE_P checks if the block can be safely freed. */ ------------------------------------------------------------ revno: 117247 committer: RĂ¼diger Sonderfeld branch nick: trunk timestamp: Tue 2014-06-03 11:06:18 +0200 message: register.el: Add link to Emacs manual in Commentary. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 19:02:31 +0000 +++ lisp/ChangeLog 2014-06-03 09:06:18 +0000 @@ -1,3 +1,7 @@ +2014-06-03 RĂ¼diger Sonderfeld + + * register.el: Add link to Emacs manual in Commentary. + 2014-06-02 Sam Steingold * menu-bar.el (lookup-key-ignore-too-long): Extract from... === modified file 'lisp/register.el' --- lisp/register.el 2014-05-27 14:36:07 +0000 +++ lisp/register.el 2014-06-03 09:06:18 +0000 @@ -27,7 +27,7 @@ ;; This package of functions emulates and somewhat extends the venerable ;; TECO's `register' feature, which permits you to save various useful ;; pieces of buffer state to named variables. The entry points are -;; documented in the Emacs user's manual. +;; documented in the Emacs user's manual: (info "(emacs) Registers"). (eval-when-compile (require 'cl-lib)) ------------------------------------------------------------ revno: 117246 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-06-03 10:28:07 +0300 message: Define the size of dumped data for MS-Windows locally on w32heap.c. configure.ac (C_HEAP_SWITCH): Remove. src/w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use HEAPSIZE; instead, define separate values for the 32- and 64-bit builds. src/Makefile.in (C_HEAP_SWITCH): Remove. (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH). diff: === modified file 'ChangeLog' --- ChangeLog 2014-06-02 00:18:22 +0000 +++ ChangeLog 2014-06-03 07:28:07 +0000 @@ -1,3 +1,7 @@ +2014-06-03 Eli Zaretskii + + * configure.ac (C_HEAP_SWITCH): Remove. + 2014-06-02 Paul Eggert Fix port to 32-bit AIX with xlc (Bug#17598). === modified file 'configure.ac' --- configure.ac 2014-06-02 00:18:22 +0000 +++ configure.ac 2014-06-03 07:28:07 +0000 @@ -4835,18 +4835,6 @@ AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) -## MinGW-specific compilation switch. -C_HEAP_SWITCH= -if test "${opsys}" = "mingw32"; then - ## Preload heap size of temacs.exe in MB. - case "$canonical" in - x86_64-*-*) C_HEAP_SWITCH="-DHEAPSIZE=18" ;; - *) C_HEAP_SWITCH="-DHEAPSIZE=12" ;; - esac -fi - -AC_SUBST(C_HEAP_SWITCH) - ## Common for all window systems if test "$window_system" != "none"; then AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-03 06:51:18 +0000 +++ src/ChangeLog 2014-06-03 07:28:07 +0000 @@ -1,5 +1,12 @@ 2014-06-03 Eli Zaretskii + * w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use + HEAPSIZE; instead, define separate values for the 32- and 64-bit + builds. + + * Makefile.in (C_HEAP_SWITCH): Remove. + (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH). + Fix MS-Windows build broken by menu changes on 2014-06-02. * w32menu.c (w32_menu_show): Fix a typo that broke compilation. === modified file 'src/Makefile.in' --- src/Makefile.in 2014-06-02 00:18:22 +0000 +++ src/Makefile.in 2014-06-03 07:28:07 +0000 @@ -86,9 +86,6 @@ ## something similar. This is normally set by configure. C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ -## Set Emacs dumped heap size for Windows NT -C_HEAP_SWITCH=@C_HEAP_SWITCH@ - ## Define LD_SWITCH_X_SITE to contain any special flags your loader ## may need to deal with X Windows. For instance, if your X libraries ## aren't in a place that your loader can find on its own, you might @@ -322,7 +319,7 @@ ## ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG. ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ - -I$(lib) -I$(srcdir)/../lib $(C_HEAP_SWITCH) \ + -I$(lib) -I$(srcdir)/../lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ $(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \ === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-02 17:19:19 +0000 +++ src/w32heap.c 2014-06-03 07:28:07 +0000 @@ -108,7 +108,19 @@ be freed anyway), and we use a new private heap for all new allocations. */ -unsigned char dumped_data[DUMPED_HEAP_SIZE]; +/* FIXME: Most of the space reserved for dumped_data[] is only used by + the 1st bootstrap-emacs.exe built while bootstrapping. Once the + preloaded Lisp files are byte-compiled, the next loadup uses less + than half of the size stated below. It would be nice to find a way + to build only the first bootstrap-emacs.exe with the large size, + and reset that to a lower value afterwards. */ +#ifdef _WIN64 +# define DUMPED_HEAP_SIZE (18*1024*1024) +#else +# define DUMPED_HEAP_SIZE (12*1024*1024) +#endif + +static unsigned char dumped_data[DUMPED_HEAP_SIZE]; /* Info for managing our preload heap, which is essentially a fixed size data area in the executable. */ === modified file 'src/w32heap.h' --- src/w32heap.h 2014-05-29 15:21:08 +0000 +++ src/w32heap.h 2014-06-03 07:28:07 +0000 @@ -28,10 +28,6 @@ * Heap related stuff. */ -#define DUMPED_HEAP_SIZE (HEAPSIZE*1024*1024) - -extern unsigned char dumped_data[]; - extern unsigned char *get_data_start (void); extern unsigned char *get_data_end (void); extern size_t reserved_heap_size; ------------------------------------------------------------ revno: 117245 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-06-03 09:51:18 +0300 message: Fix MS-Windows build broken by menu changes on 2014-06-02. src/w32menu.c (w32_menu_show): Fix a typo that broke compilation. src/menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]: Define instead of including ../lwlib/lwlib.h, which causes compilation errors due to missing X11 headers. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-03 00:44:30 +0000 +++ src/ChangeLog 2014-06-03 06:51:18 +0000 @@ -1,3 +1,12 @@ +2014-06-03 Eli Zaretskii + + Fix MS-Windows build broken by menu changes on 2014-06-02. + * w32menu.c (w32_menu_show): Fix a typo that broke compilation. + + * menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]: + Define instead of including ../lwlib/lwlib.h, which causes + compilation errors due to missing X11 headers. + 2014-06-03 Paul Eggert * process.c (wait_reading_process_output): Omit incorrect test === modified file 'src/menu.h' --- src/menu.h 2014-06-02 18:01:21 +0000 +++ src/menu.h 2014-06-03 06:51:18 +0000 @@ -20,12 +20,52 @@ #define MENU_H #include "systime.h" /* for Time */ -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \ - || defined (HAVE_NS) +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) #include "../lwlib/lwlib.h" /* for widget_value */ #endif #ifdef HAVE_NTGUI +/* This is based on the one in ../lwlib/lwlib.h, with unused portions + removed. HAVE_NTGUI cannot include lwlib.h, as that pulls in X11 + headers. */ + +enum button_type +{ + BUTTON_TYPE_NONE, + BUTTON_TYPE_TOGGLE, + BUTTON_TYPE_RADIO +}; + +typedef struct _widget_value +{ + /* name of widget */ + Lisp_Object lname; + const char* name; + /* value (meaning depend on widget type) */ + const char* value; + /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; + const char* key; + /* Help string or nil if none. + GC finds this string through the frame's menu_bar_vector + or through menu_items. */ + Lisp_Object help; + /* true if enabled */ + unsigned char enabled; + /* true if selected */ + unsigned char selected; + /* The type of a button. */ + enum button_type button_type; + /* true if menu title */ + unsigned char title; + /* Contents of the sub-widgets, also selected slot for checkbox */ + struct _widget_value* contents; + /* data passed to callback */ + void *call_data; + /* next one in the list */ + struct _widget_value* next; +} widget_value; + extern Lisp_Object Qunsupported__w32_dialog; #endif === modified file 'src/w32menu.c' --- src/w32menu.c 2014-06-02 18:01:21 +0000 +++ src/w32menu.c 2014-06-03 06:51:18 +0000 @@ -697,7 +697,7 @@ ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip); } - wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enabled), + wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable), STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; ------------------------------------------------------------ revno: 117244 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2014-06-03 08:17:53 +0400 message: * xlwmenu.c (openXftFont): Do not load regular X font here. (XlwMenuInitialize): Remove ancient #if 0 code. (XlwMenuDestroy): Likewise. Free regular X font here. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2014-06-02 18:01:21 +0000 +++ lwlib/ChangeLog 2014-06-03 04:17:53 +0000 @@ -1,3 +1,9 @@ +2014-06-03 Dmitry Antipov + + * xlwmenu.c (openXftFont): Do not load regular X font here. + (XlwMenuInitialize): Remove ancient #if 0 code. + (XlwMenuDestroy): Likewise. Free regular X font here. + 2014-06-02 Dmitry Antipov Use common memory management functions for widgets. === modified file 'lwlib/xlwmenu.c' --- lwlib/xlwmenu.c 2014-01-01 07:43:34 +0000 +++ lwlib/xlwmenu.c 2014-06-03 04:17:53 +0000 @@ -1863,16 +1863,9 @@ fname[i] = '-'; } - mw->menu.font = XLoadQueryFont (XtDisplay (mw), fname); - if (!mw->menu.font) - { - mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname); - if (!mw->menu.xft_font) - { - fprintf (stderr, "Can't find font '%s'\n", fname); - mw->menu.xft_font = getDefaultXftFont (mw); - } - } + mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname); + if (!mw->menu.xft_font) + mw->menu.xft_font = getDefaultXftFont (mw); } if (fname != mw->menu.fontName) xfree (fname); @@ -1889,15 +1882,6 @@ Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw))); Display* display = XtDisplay (mw); -#if 0 - widget_value *tem = (widget_value *) XtMalloc (sizeof (widget_value)); - - /* _XtCreate is freeing the object that was passed to us, - so make a copy that we will actually keep. */ - memcpy (tem, mw->menu.contents, sizeof (widget_value)); - mw->menu.contents = tem; -#endif - /* mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */ mw->menu.cursor = mw->menu.cursor_shape; @@ -2074,19 +2058,15 @@ XFreePixmap (XtDisplay (mw), mw->menu.gray_pixmap); mw->menu.gray_pixmap = (Pixmap) -1; -#if 0 - /* Do free mw->menu.contents because nowadays we copy it - during initialization. */ - XtFree (mw->menu.contents); -#endif - /* Don't free mw->menu.contents because that comes from our creator. The `*_stack' elements are just pointers into `contents' so leave that alone too. But free the stacks themselves. */ if (mw->menu.old_stack) XtFree ((char *) mw->menu.old_stack); if (mw->menu.new_stack) XtFree ((char *) mw->menu.new_stack); - /* Remember, you can't free anything that came from the resource + /* Original comment was: + + Remember, you can't free anything that came from the resource database. This includes: mw->menu.cursor mw->menu.top_shadow_pixmap @@ -2095,7 +2075,11 @@ Also the color cells of top_shadow_color, bottom_shadow_color, foreground, and button_foreground will never be freed until this client exits. Nice, eh? - */ + + But now I can free font without any visible glitches. */ + + if (mw->menu.font) + XFreeFont (XtDisplay (mw), mw->menu.font); #ifdef HAVE_XFT if (mw->menu.windows [0].xft_draw) ------------------------------------------------------------ revno: 117243 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-06-02 17:44:30 -0700 message: * process.c (wait_reading_process_output): Omit incorrect test of p->infd against zero. Add easserts for infd having a plausible value. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-02 18:01:21 +0000 +++ src/ChangeLog 2014-06-03 00:44:30 +0000 @@ -1,3 +1,9 @@ +2014-06-03 Paul Eggert + + * process.c (wait_reading_process_output): Omit incorrect test + of p->infd against zero. Add easserts for infd having a plausible + value. + 2014-06-02 Dmitry Antipov Adjust to match recent lwlib changes. === modified file 'src/process.c' --- src/process.c 2014-05-27 03:46:30 +0000 +++ src/process.c 2014-06-03 00:44:30 +0000 @@ -4630,12 +4630,13 @@ { struct Lisp_Process *p = XPROCESS (chan_process[channel]); - if (p && p->gnutls_p && p->gnutls_state && p->infd + if (p && p->gnutls_p && p->gnutls_state && ((emacs_gnutls_record_check_pending (p->gnutls_state)) > 0)) { nfds++; + eassert (p->infd == channel); FD_SET (p->infd, &Available); } } @@ -4651,6 +4652,8 @@ > 0)) { nfds = 1; + eassert (0 <= wait_proc->infd + && wait_proc->infd < FD_SETSIZE); /* Set to Available. */ FD_SET (wait_proc->infd, &Available); } ------------------------------------------------------------ revno: 117242 committer: Sam Steingold branch nick: trunk timestamp: Mon 2014-06-02 15:02:31 -0400 message: Avoid the type error on f10 when lookup-key returns an number. * lisp/menu-bar.el (lookup-key-ignore-too-long): Extract from... (popup-menu): ...here. (menu-bar-open): Use it to avoid an error when `lookup-key' returns a number. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 18:36:47 +0000 +++ lisp/ChangeLog 2014-06-02 19:02:31 +0000 @@ -1,3 +1,10 @@ +2014-06-02 Sam Steingold + + * menu-bar.el (lookup-key-ignore-too-long): Extract from... + (popup-menu): ...here. + (menu-bar-open): Use it to avoid an error when `lookup-key' + returns a number. + 2014-06-02 Michael Albinus * net/tramp.el (tramp-call-process): Add traces. === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2014-05-21 16:35:31 +0000 +++ lisp/menu-bar.el 2014-06-02 19:02:31 +0000 @@ -2140,6 +2140,13 @@ (declare-function x-menu-bar-open "term/x-win" (&optional frame)) (declare-function w32-menu-bar-open "term/w32-win" (&optional frame)) +(defun lookup-key-ignore-too-long (map key) + "Call `lookup-key' and convert numeric values to nil." + (let ((binding (lookup-key map key))) + (if (numberp binding) ; `too long' + nil + binding))) + (defun popup-menu (menu &optional position prefix from-menu-bar) "Popup the given menu and call the selected option. MENU can be a keymap, an easymenu-style menu or a list of keymaps as for @@ -2192,11 +2199,9 @@ (let ((mouse-click (apply 'vector event)) binding) (while (and map (null binding)) - (setq binding (lookup-key (car map) mouse-click)) - (if (numberp binding) ; `too long' - (setq binding nil)) + (setq binding (lookup-key-ignore-too-long (car map) mouse-click)) (setq map (cdr map))) - binding)) + binding)) (t ;; We were given a single keymap. (lookup-key map (apply 'vector event))))) @@ -2270,8 +2275,10 @@ (let* ((x tty-menu--initial-menu-x) (menu (menu-bar-menu-at-x-y x 0 frame))) (popup-menu (or - (lookup-key global-map (vector 'menu-bar menu)) - (lookup-key (current-local-map) (vector 'menu-bar menu)) + (lookup-key-ignore-too-long + global-map (vector 'menu-bar menu)) + (lookup-key-ignore-too-long + (current-local-map) (vector 'menu-bar menu)) (cdar (minor-mode-key-binding (vector 'menu-bar menu)))) (posn-at-x-y x 0 nil t) nil t))) (t (with-selected-frame (or frame (selected-frame)) ------------------------------------------------------------ revno: 117241 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 20:38:22 +0200 message: * test/automated/tramp-tests.el (tramp-test29-vc-registered): Remove instrumentation. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-06-02 09:53:43 +0000 +++ test/ChangeLog 2014-06-02 18:38:22 +0000 @@ -1,7 +1,7 @@ 2014-06-02 Michael Albinus * automated/tramp-tests.el (tramp-remote-process-environment): Declare. - (tramp-test29-vc-registered): Set $BZR_HOME. + (tramp-test29-vc-registered): Set $BZR_HOME. Remove instrumentation. 2014-06-01 Michael Albinus === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2014-06-02 09:53:43 +0000 +++ test/automated/tramp-tests.el 2014-06-02 18:38:22 +0000 @@ -1395,7 +1395,6 @@ (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) 'tramp-sh-file-name-handler)) - (tramp--instrument-test-case 10 (let* ((default-directory tramp-test-temporary-file-directory) (tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (expand-file-name "foo" tmp-name1)) @@ -1440,12 +1439,7 @@ (list (file-name-nondirectory tmp-name2))))) (should (vc-registered tmp-name2))) - (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil - (with-current-buffer (tramp-get-connection-buffer v) - (message "%s" (buffer-string))) - (with-current-buffer (tramp-get-debug-buffer v) - (message "%s" (buffer-string)))) - (ignore-errors (delete-directory tmp-name1 'recursive)))))) + (ignore-errors (delete-directory tmp-name1 'recursive))))) (defun tramp--test-check-files (&rest files) "Runs a simple but comprehensive test over every file in FILES." ------------------------------------------------------------ revno: 117240 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 20:36:47 +0200 message: * net/tramp.el (with-tramp-progress-reporter): Remove traces. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 15:17:39 +0000 +++ lisp/ChangeLog 2014-06-02 18:36:47 +0000 @@ -1,7 +1,6 @@ 2014-06-02 Michael Albinus - * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): - Add traces. + * net/tramp.el (tramp-call-process): Add traces. (tramp-handle-unhandled-file-name-directory): Return "/". 2014-06-02 Wilson Snyder === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 15:17:39 +0000 +++ lisp/net/tramp.el 2014-06-02 18:36:47 +0000 @@ -1673,18 +1673,10 @@ #'tramp-progress-reporter-update pr))))))) (unwind-protect ;; Execute the body. - (prog1 - (condition-case err - (progn ,@body) - (error - (tramp-message ,vec 6 "%s" (error-message-string err)) - ;; Propagate the error. - (signal (car err) (cdr err)))) - (setq cookie "done")) + (prog1 (progn ,@body) (setq cookie "done")) ;; Stop progress reporter. (if tm (tramp-compat-funcall 'cancel-timer tm)) - (tramp-message ,vec ,level "%s...%s" ,message cookie) - (when (string-equal "failed" cookie) (tramp-backtrace ,vec)))))) + (tramp-message ,vec ,level "%s...%s" ,message cookie))))) (tramp-compat-font-lock-add-keywords 'emacs-lisp-mode '("\\")) ------------------------------------------------------------ revno: 117239 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-06-02 22:01:21 +0400 message: Use common memory management functions for lwlib and refactor users. * lwlib/lwlib.h (widget_value): Do not maintain a free list any more. (malloc_widget_value, free_widget_value): Remove prototypes. * lwlib/lwlib.c (malloc_widget_value, free_widget_value): (widget_value_free_list, malloc_cpt): Remove. (free_widget_value_tree, copy_widget_value_tree): Adjust users. * src/menu.h (xmalloc_widget_value): Replaced by ... (make_widget_value): ... new prototype. * src/menu.c (xmalloc_widget_value): Replaced by ... (make_widget_value): ... new function. (free_menubar_widget_value_tree, digest_single_submenu): Adjust users. * src/gtkutil.c (malloc_widget_value, free_widget_value): (widget_value_free_list, malloc_cpt): Remove old lwlib-compatible code. * src/keyboard.h (enum button_type, struct _widget_value): * src/gtkutil.h, src/nsgui.h, src/w32gui.h (malloc_widget_value): (free_widget_value): Likewise. * src/nsmenu.m (ns_update_menubar, ns_menu_show): * src/w32menu.c (set_frame_menubar, w32_menu_show, w32_dialog_show): * src/xmenu.c (set_frame_menubar, xmenu_show, x_dialog_show): Adjust users. * src/xterm.h (XtParent) [USE_GTK]: Remove unused macro. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2014-05-30 13:22:29 +0000 +++ lwlib/ChangeLog 2014-06-02 18:01:21 +0000 @@ -1,3 +1,12 @@ +2014-06-02 Dmitry Antipov + + Use common memory management functions for widgets. + * lwlib.h (widget_value): Do not maintain a free list any more. + (malloc_widget_value, free_widget_value): Remove prototypes. + * lwlib.c (malloc_widget_value, free_widget_value): + (widget_value_free_list, malloc_cpt): Remove. + (free_widget_value_tree, copy_widget_value_tree): Adjust users. + 2014-05-30 Dmitry Antipov Use common string allocation and freeing functions where applicable. === modified file 'lwlib/lwlib.c' --- lwlib/lwlib.c 2014-05-30 13:22:29 +0000 +++ lwlib/lwlib.c 2014-06-02 18:01:21 +0000 @@ -99,51 +99,6 @@ static Boolean get_one_value (widget_instance *, widget_value *); static void show_one_widget_busy (Widget, Boolean); -static widget_value *widget_value_free_list = 0; -static int malloc_cpt = 0; - -widget_value * -malloc_widget_value (void) -{ - widget_value *wv; - if (widget_value_free_list) - { - wv = widget_value_free_list; - widget_value_free_list = wv->free_list; - wv->free_list = 0; - } - else - { - wv = (widget_value *) xmalloc (sizeof (widget_value)); - malloc_cpt++; - } - memset ((void*) wv, 0, sizeof (widget_value)); - return wv; -} - -/* this is analogous to free(). It frees only what was allocated - by malloc_widget_value(), and no substructures. - */ -void -free_widget_value (widget_value *wv) -{ - if (wv->free_list) - abort (); - - if (malloc_cpt > 25) - { - /* When the number of already allocated cells is too big, - We free it. */ - xfree (wv); - malloc_cpt--; - } - else - { - wv->free_list = widget_value_free_list; - widget_value_free_list = wv; - } -} - static void free_widget_value_tree (widget_value *wv) { @@ -172,7 +127,7 @@ free_widget_value_tree (wv->next); wv->next = (widget_value *) 0xDEADBEEF; } - free_widget_value (wv); + xfree (wv); } static widget_value * @@ -185,7 +140,8 @@ if (val == (widget_value *) 1) return val; - copy = malloc_widget_value (); + copy = xmalloc (sizeof (widget_value)); + copy->lname = copy->lkey = Qnil; copy->name = xstrdup (val->name); copy->value = val->value ? xstrdup (val->value) : NULL; copy->key = val->key ? xstrdup (val->key) : NULL; === modified file 'lwlib/lwlib.h' --- lwlib/lwlib.h 2014-01-01 07:43:34 +0000 +++ lwlib/lwlib.h 2014-06-02 18:01:21 +0000 @@ -119,11 +119,6 @@ /* tell us if we should free the toolkit data slot when freeing the widget_value itself. */ Boolean free_toolkit_data; - - /* we resource the widget_value structures; this points to the next - one on the free list if this one has been deallocated. - */ - struct _widget_value *free_list; } widget_value; @@ -153,8 +148,6 @@ Boolean lw_get_some_values (LWLIB_ID id, widget_value* val); void lw_pop_up_all_widgets (LWLIB_ID id); void lw_pop_down_all_widgets (LWLIB_ID id); -widget_value *malloc_widget_value (void); -void free_widget_value (widget_value *); void lw_popup_menu (Widget, XEvent *); /* Toolkit independent way of focusing on a Widget at the Xt level. */ === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-02 17:55:38 +0000 +++ src/ChangeLog 2014-06-02 18:01:21 +0000 @@ -1,5 +1,23 @@ 2014-06-02 Dmitry Antipov + Adjust to match recent lwlib changes. + * menu.h (xmalloc_widget_value): Replaced by ... + (make_widget_value): ... new prototype. + * menu.c (xmalloc_widget_value): Replaced by ... + (make_widget_value): ... new function. + (free_menubar_widget_value_tree, digest_single_submenu): Adjust users. + * gtkutil.c (malloc_widget_value, free_widget_value): + (widget_value_free_list, malloc_cpt): Remove old lwlib-compatible code. + * keyboard.h (enum button_type, struct _widget_value): + * gtkutil.h, nsgui.h, w32gui.h (malloc_widget_value, free_widget_value): + Likewise. + * nsmenu.m (ns_update_menubar, ns_menu_show): + * w32menu.c (set_frame_menubar, w32_menu_show, w32_dialog_show): + * xmenu.c (set_frame_menubar, xmenu_show, x_dialog_show): Adjust users. + * xterm.h (XtParent) [USE_GTK]: Remove unused macro. + +2014-06-02 Dmitry Antipov + * image.c (x_query_frame_background_color) [HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG]: Fix --enable-gcc-warnings compilation without image libraries. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2014-02-28 21:45:34 +0000 +++ src/gtkutil.c 2014-06-02 18:01:21 +0000 @@ -221,57 +221,6 @@ /*********************************************************************** Utility functions ***********************************************************************/ -/* The next two variables and functions are taken from lwlib. */ -static widget_value *widget_value_free_list; -static int malloc_cpt; - -/* Allocate a widget_value structure, either by taking one from the - widget_value_free_list or by malloc:ing a new one. - - Return a pointer to the allocated structure. */ - -widget_value * -malloc_widget_value (void) -{ - widget_value *wv; - if (widget_value_free_list) - { - wv = widget_value_free_list; - widget_value_free_list = wv->free_list; - wv->free_list = 0; - } - else - { - wv = xmalloc (sizeof *wv); - malloc_cpt++; - } - memset (wv, 0, sizeof (widget_value)); - return wv; -} - -/* This is analogous to free. It frees only what was allocated - by malloc_widget_value, and no substructures. */ - -void -free_widget_value (widget_value *wv) -{ - if (wv->free_list) - emacs_abort (); - - if (malloc_cpt > 25) - { - /* When the number of already allocated cells is too big, - We free it. */ - xfree (wv); - malloc_cpt--; - } - else - { - wv->free_list = widget_value_free_list; - widget_value_free_list = wv; - } -} - /* Create and return the cursor to be used for popup menus and scroll bars on display DPY. */ === modified file 'src/gtkutil.h' --- src/gtkutil.h 2014-05-22 16:40:35 +0000 +++ src/gtkutil.h 2014-06-02 18:01:21 +0000 @@ -24,6 +24,7 @@ #ifdef USE_GTK #include +#include "../lwlib/lwlib.h" #include "frame.h" #include "xterm.h" @@ -74,9 +75,6 @@ } xg_menu_item_cb_data; -extern struct _widget_value *malloc_widget_value (void) ATTRIBUTE_MALLOC; -extern void free_widget_value (struct _widget_value *); - extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST; extern char *xg_get_file_name (struct frame *f, === modified file 'src/keyboard.h' --- src/keyboard.h 2014-01-01 07:43:34 +0000 +++ src/keyboard.h 2014-06-02 18:01:21 +0000 @@ -354,57 +354,6 @@ #define ENCODE_MENU_STRING(str) (str) #endif -#if defined (HAVE_NS) || defined (HAVE_NTGUI) || defined (USE_GTK) - -/* Definitions copied from lwlib.h */ - -enum button_type -{ - BUTTON_TYPE_NONE, - BUTTON_TYPE_TOGGLE, - BUTTON_TYPE_RADIO -}; - -/* This structure is based on the one in ../lwlib/lwlib.h, with unused portions - removed. No term uses these. */ -typedef struct _widget_value -{ - /* name of widget */ - Lisp_Object lname; - const char* name; - /* value (meaning depend on widget type) */ - const char* value; - /* keyboard equivalent. no implications for XtTranslations */ - Lisp_Object lkey; - const char* key; - /* Help string or nil if none. - GC finds this string through the frame's menu_bar_vector - or through menu_items. */ - Lisp_Object help; - /* true if enabled */ - unsigned char enabled; - /* true if selected */ - unsigned char selected; - /* The type of a button. */ - enum button_type button_type; -#if defined (HAVE_NTGUI) - /* true if menu title */ - unsigned char title; -#endif - /* Contents of the sub-widgets, also selected slot for checkbox */ - struct _widget_value* contents; - /* data passed to callback */ - void *call_data; - /* next one in the list */ - struct _widget_value* next; -#ifdef USE_GTK - struct _widget_value *free_list; -#endif -} widget_value; - -#endif /* HAVE_NS || HAVE_NTGUI */ - - /* Macros for dealing with lispy events. */ /* True if EVENT has data fields describing it (i.e. a mouse click). */ === modified file 'src/menu.c' --- src/menu.c 2014-04-16 13:27:28 +0000 +++ src/menu.c 2014-06-02 18:01:21 +0000 @@ -576,21 +576,26 @@ #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI) -/* Allocate a widget_value, blocking input. */ +/* Allocate and basically initialize widget_value, blocking input. */ widget_value * -xmalloc_widget_value (void) +make_widget_value (const char *name, char *value, + bool enabled, Lisp_Object help) { - widget_value *value; + widget_value *wv; block_input (); - value = malloc_widget_value (); + wv = xzalloc (sizeof (widget_value)); unblock_input (); - return value; + wv->name = (char *) name; + wv->value = value; + wv->enabled = enabled; + wv->help = help; + return wv; } -/* This recursively calls free_widget_value on the tree of widgets. +/* This recursively calls xfree on the tree of widgets. It must free all data that was malloc'ed for these widget_values. In Emacs, many slots are pointers into the data of Lisp_Strings, and must be left alone. */ @@ -613,7 +618,7 @@ wv->next = (widget_value *) 0xDEADBEEF; } block_input (); - free_widget_value (wv); + xfree (wv); unblock_input (); } @@ -632,12 +637,8 @@ struct frame *f = XFRAME (Vmenu_updating_frame); submenu_stack = alloca (menu_items_used * sizeof *submenu_stack); - wv = xmalloc_widget_value (); - wv->name = "menu"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menu", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; save_wv = 0; prev_wv = 0; @@ -721,17 +722,14 @@ with its items as a submenu beneath it. */ if (strcmp (pane_string, "")) { - wv = xmalloc_widget_value (); + /* Set value to 1 so update_submenu_strings can handle '@'. */ + wv = make_widget_value (NULL, (char *) 1, true, Qnil); if (save_wv) save_wv->next = wv; else first_wv->contents = wv; wv->lname = pane_name; - /* Set value to 1 so update_submenu_strings can handle '@' */ - wv->value = (char *)1; - wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; save_wv = wv; } else @@ -805,7 +803,8 @@ #endif } - wv = xmalloc_widget_value (); + wv = make_widget_value (NULL, NULL, !NILP (enable), + STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; else @@ -814,11 +813,9 @@ wv->lname = item_name; if (!NILP (descrip)) wv->lkey = descrip; - wv->value = 0; /* The intptr_t cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ wv->call_data = (!NILP (def) ? (void *) (intptr_t) i : 0); - wv->enabled = !NILP (enable); if (NILP (type)) wv->button_type = BUTTON_TYPE_NONE; @@ -830,10 +827,6 @@ emacs_abort (); wv->selected = !NILP (selected); - if (! STRINGP (help)) - help = Qnil; - - wv->help = help; prev_wv = wv; @@ -846,7 +839,7 @@ if (top_level_items && first_wv->contents && first_wv->contents->next == 0) { wv = first_wv->contents; - free_widget_value (first_wv); + xfree (first_wv); return wv; } === modified file 'src/menu.h' --- src/menu.h 2014-02-04 16:13:51 +0000 +++ src/menu.h 2014-06-02 18:01:21 +0000 @@ -20,6 +20,10 @@ #define MENU_H #include "systime.h" /* for Time */ +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \ + || defined (HAVE_NS) +#include "../lwlib/lwlib.h" /* for widget_value */ +#endif #ifdef HAVE_NTGUI extern Lisp_Object Qunsupported__w32_dialog; @@ -41,7 +45,7 @@ extern void update_submenu_strings (widget_value *); extern void find_and_call_menu_selection (struct frame *, int, Lisp_Object, void *); -extern widget_value *xmalloc_widget_value (void); +extern widget_value *make_widget_value (const char *, char *, bool, Lisp_Object); extern widget_value *digest_single_submenu (int, int, bool); #endif === modified file 'src/nsgui.h' --- src/nsgui.h 2014-01-01 07:43:34 +0000 +++ src/nsgui.h 2014-06-02 18:01:21 +0000 @@ -48,11 +48,6 @@ #undef _GL_VERIFY_H #include -/* menu-related */ -#define free_widget_value(wv) xfree (wv) -#define malloc_widget_value() ((widget_value *) memset (xmalloc \ - (sizeof (widget_value)), 0, sizeof (widget_value))) - /* Emulate XCharStruct. */ typedef struct _XCharStruct { === modified file 'src/nsmenu.m' --- src/nsmenu.m 2014-04-07 20:54:16 +0000 +++ src/nsmenu.m 2014-06-02 18:01:21 +0000 @@ -266,12 +266,8 @@ /* parse stage 2: insert into lucid 'widget_value' structures [comments in other terms say not to evaluate lisp code here] */ - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; for (i = 0; i < 4*n; i += 4) @@ -378,12 +374,8 @@ int n; Lisp_Object string; - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; /* Make widget-value tree w/ just the top level menu bar strings */ @@ -439,12 +431,8 @@ memcpy (previous_strings[i/4], SDATA (string), min (10, SBYTES (string) + 1)); - wv = xmalloc_widget_value (); - wv->name = SSDATA (string); - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value (SSDATA (string), NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; wv->call_data = (void *) (intptr_t) (-1); #ifdef NS_IMPL_COCOA @@ -838,12 +826,8 @@ p.x = x; p.y = y; /* now parse stage 2 as in ns_update_menubar */ - wv = xmalloc_widget_value (); - wv->name = "contextmenu"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("contextmenu", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; #if 0 @@ -914,18 +898,14 @@ with its items as a submenu beneath it. */ if (!keymaps && strcmp (pane_string, "")) { - wv = xmalloc_widget_value (); + wv = make_widget_value (pane_string, NULL, true, Qnil); if (save_wv) save_wv->next = wv; else first_wv->contents = wv; - wv->name = pane_string; if (keymaps && !NILP (prefix)) wv->name++; - wv->value = 0; - wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; save_wv = wv; prev_wv = 0; } @@ -963,20 +943,18 @@ } #endif /* not HAVE_MULTILINGUAL_MENU */ - wv = xmalloc_widget_value (); + wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enabled), + STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; else save_wv->contents = wv; - wv->name = SSDATA (item_name); if (!NILP (descrip)) wv->key = SSDATA (descrip); - wv->value = 0; /* If this item has a null value, make the call_data null so that it won't display a box when the mouse is on it. */ wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0; - wv->enabled = !NILP (enable); if (NILP (type)) wv->button_type = BUTTON_TYPE_NONE; @@ -989,11 +967,6 @@ wv->selected = !NILP (selected); - if (! STRINGP (help)) - help = Qnil; - - wv->help = help; - prev_wv = wv; i += MENU_ITEMS_ITEM_LENGTH; @@ -1004,24 +977,19 @@ if (!NILP (title)) { - widget_value *wv_title = xmalloc_widget_value (); - widget_value *wv_sep = xmalloc_widget_value (); + widget_value *wv_title; + widget_value *wv_sep = make_widget_value ("--", NULL, false, Qnil); /* Maybe replace this separator with a bitmap or owner-draw item so that it looks better. Having two separators looks odd. */ - wv_sep->name = "--"; wv_sep->next = first_wv->contents; - wv_sep->help = Qnil; #ifndef HAVE_MULTILINGUAL_MENU if (STRING_MULTIBYTE (title)) title = ENCODE_MENU_STRING (title); #endif - - wv_title->name = SSDATA (title); - wv_title->enabled = NO; + wv_title = make_widget_value (SSDATA (title), NULL, false, Qnil); wv_title->button_type = BUTTON_TYPE_NONE; - wv_title->help = Qnil; wv_title->next = wv_sep; first_wv->contents = wv_title; } === modified file 'src/w32gui.h' --- src/w32gui.h 2014-01-01 07:43:34 +0000 +++ src/w32gui.h 2014-06-02 18:01:21 +0000 @@ -22,14 +22,11 @@ #include "systime.h" /* for Time */ -/* Local memory management for menus. */ +/* FIXME: old local memory management for menus. */ #define local_heap (GetProcessHeap ()) #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p)))) -#define malloc_widget_value() ((widget_value *) local_alloc (sizeof (widget_value))) -#define free_widget_value(wv) (local_free ((wv))) - /* Emulate X GC's by keeping color and font info in a structure. */ typedef struct _XGCValues { === modified file 'src/w32menu.c' --- src/w32menu.c 2014-05-29 17:16:00 +0000 +++ src/w32menu.c 2014-06-02 18:01:21 +0000 @@ -376,12 +376,8 @@ /* Convert menu_items into widget_value trees to display the menu. This cannot evaluate Lisp code. */ - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; for (i = 0; i < last_i; i += 4) @@ -444,12 +440,8 @@ /* Make a widget-value tree containing just the top level menu bar strings. */ - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; items = FRAME_MENU_BAR_ITEMS (f); @@ -461,12 +453,8 @@ if (NILP (string)) break; - wv = xmalloc_widget_value (); - wv->name = SSDATA (string); - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value (SSDATA (string), NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; /* This prevents lwlib from assuming this menu item is really supposed to be empty. */ /* The EMACS_INT cast avoids a warning. @@ -600,12 +588,8 @@ /* Create a tree of widget_value objects representing the panes and their items. */ - wv = xmalloc_widget_value (); - wv->name = "menu"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menu", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; first_pane = 1; @@ -665,18 +649,14 @@ with its items as a submenu beneath it. */ if (!keymaps && strcmp (pane_string, "")) { - wv = xmalloc_widget_value (); + wv = make_widget_value (pane_string, NULL, true, Qnil); if (save_wv) save_wv->next = wv; else first_wv->contents = wv; - wv->name = pane_string; if (keymaps && !NILP (prefix)) wv->name++; - wv->value = 0; - wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; save_wv = wv; prev_wv = 0; } @@ -717,19 +697,17 @@ ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip); } - wv = xmalloc_widget_value (); + wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enabled), + STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; else save_wv->contents = wv; - wv->name = SSDATA (item_name); if (!NILP (descrip)) wv->key = SSDATA (descrip); - wv->value = 0; /* Use the contents index as call_data, since we are restricted to 16-bits. */ wv->call_data = !NILP (def) ? (void *) (EMACS_INT) i : 0; - wv->enabled = !NILP (enable); if (NILP (type)) wv->button_type = BUTTON_TYPE_NONE; @@ -742,11 +720,6 @@ wv->selected = !NILP (selected); - if (!STRINGP (help)) - help = Qnil; - - wv->help = help; - prev_wv = wv; i += MENU_ITEMS_ITEM_LENGTH; @@ -756,25 +729,21 @@ /* Deal with the title, if it is non-nil. */ if (!NILP (title)) { - widget_value *wv_title = xmalloc_widget_value (); - widget_value *wv_sep = xmalloc_widget_value (); + widget_value *wv_title; + widget_value *wv_sep = make_widget_value ("--", NULL, false, Qnil); /* Maybe replace this separator with a bitmap or owner-draw item so that it looks better. Having two separators looks odd. */ - wv_sep->name = "--"; wv_sep->next = first_wv->contents; - wv_sep->help = Qnil; if (unicode_append_menu) title = ENCODE_UTF_8 (title); else if (STRING_MULTIBYTE (title)) title = ENCODE_SYSTEM (title); - wv_title->name = SSDATA (title); - wv_title->enabled = TRUE; + wv_title = make_widget_value (SSDATA (title), NULL, true, Qnil); wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; - wv_title->help = Qnil; wv_title->next = wv_sep; first_wv->contents = wv_title; } @@ -934,11 +903,7 @@ pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); - prev_wv = xmalloc_widget_value (); - prev_wv->value = pane_string; - prev_wv->enabled = 1; - prev_wv->name = "message"; - prev_wv->help = Qnil; + prev_wv = make_widget_value ("message", pane_string, true, Qnil); first_wv = prev_wv; /* Loop over all panes and items, filling in the tree. */ @@ -975,15 +940,13 @@ return Qnil; } - wv = xmalloc_widget_value (); + wv = make_widget_value (button_names[nb_buttons], + SSDATA (item_name), + !NILP (enable), Qnil); prev_wv->next = wv; - wv->name = (char *) button_names[nb_buttons]; if (!NILP (descrip)) wv->key = SSDATA (descrip); - wv->value = SSDATA (item_name); wv->call_data = aref_addr (menu_items, i); - wv->enabled = !NILP (enable); - wv->help = Qnil; prev_wv = wv; if (! boundary_seen) @@ -998,9 +961,7 @@ if (! boundary_seen) left_count = nb_buttons - nb_buttons / 2; - wv = xmalloc_widget_value (); - wv->name = dialog_name; - wv->help = Qnil; + wv = make_widget_value (dialog_name, NULL, false, Qnil); /* Frame title: 'Q' = Question, 'I' = Information. Can also have 'E' = Error if, one day, we want === modified file 'src/xmenu.c' --- src/xmenu.c 2014-05-29 17:16:00 +0000 +++ src/xmenu.c 2014-06-02 18:01:21 +0000 @@ -882,12 +882,8 @@ /* Convert menu_items into widget_value trees to display the menu. This cannot evaluate Lisp code. */ - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; for (i = 0; submenu_start[i] >= 0; i++) @@ -952,12 +948,8 @@ /* Make a widget-value tree containing just the top level menu bar strings. */ - wv = xmalloc_widget_value (); - wv->name = "menubar"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menubar", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; first_wv = wv; items = FRAME_MENU_BAR_ITEMS (f); @@ -969,12 +961,8 @@ if (NILP (string)) break; - wv = xmalloc_widget_value (); - wv->name = SSDATA (string); - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value (SSDATA (string), NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; /* This prevents lwlib from assuming this menu item is really supposed to be empty. */ /* The intptr_t cast avoids a warning. @@ -1474,12 +1462,8 @@ /* Create a tree of widget_value objects representing the panes and their items. */ - wv = xmalloc_widget_value (); - wv->name = "menu"; - wv->value = 0; - wv->enabled = 1; + wv = make_widget_value ("menu", NULL, true, Qnil); wv->button_type = BUTTON_TYPE_NONE; - wv->help =Qnil; first_wv = wv; first_pane = 1; @@ -1537,18 +1521,14 @@ with its items as a submenu beneath it. */ if (!keymaps && strcmp (pane_string, "")) { - wv = xmalloc_widget_value (); + wv = make_widget_value (pane_string, NULL, true, Qnil); if (save_wv) save_wv->next = wv; else first_wv->contents = wv; - wv->name = (char *) pane_string; if (keymaps && !NILP (prefix)) wv->name++; - wv->value = 0; - wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; - wv->help = Qnil; save_wv = wv; prev_wv = 0; } @@ -1586,20 +1566,18 @@ } #endif /* not HAVE_MULTILINGUAL_MENU */ - wv = xmalloc_widget_value (); + wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable), + STRINGP (help) ? help : Qnil); if (prev_wv) prev_wv->next = wv; else save_wv->contents = wv; - wv->name = SSDATA (item_name); if (!NILP (descrip)) wv->key = SSDATA (descrip); - wv->value = 0; /* If this item has a null value, make the call_data null so that it won't display a box when the mouse is on it. */ wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0; - wv->enabled = !NILP (enable); if (NILP (type)) wv->button_type = BUTTON_TYPE_NONE; @@ -1612,11 +1590,6 @@ wv->selected = !NILP (selected); - if (! STRINGP (help)) - help = Qnil; - - wv->help = help; - prev_wv = wv; i += MENU_ITEMS_ITEM_LENGTH; @@ -1626,27 +1599,20 @@ /* Deal with the title, if it is non-nil. */ if (!NILP (title)) { - widget_value *wv_title = xmalloc_widget_value (); - widget_value *wv_sep1 = xmalloc_widget_value (); - widget_value *wv_sep2 = xmalloc_widget_value (); + widget_value *wv_title; + widget_value *wv_sep1 = make_widget_value ("--", NULL, false, Qnil); + widget_value *wv_sep2 = make_widget_value ("--", NULL, false, Qnil); - wv_sep2->name = "--"; wv_sep2->next = first_wv->contents; - wv_sep2->help = Qnil; - - wv_sep1->name = "--"; wv_sep1->next = wv_sep2; - wv_sep1->help = Qnil; #ifndef HAVE_MULTILINGUAL_MENU if (STRING_MULTIBYTE (title)) title = ENCODE_MENU_STRING (title); #endif - wv_title->name = SSDATA (title); - wv_title->enabled = true; + wv_title = make_widget_value (SSDATA (title), NULL, true, Qnil); wv_title->button_type = BUTTON_TYPE_NONE; - wv_title->help = Qnil; wv_title->next = wv_sep1; first_wv->contents = wv_title; } @@ -1867,11 +1833,7 @@ pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); pane_string = (NILP (pane_name) ? "" : SSDATA (pane_name)); - prev_wv = xmalloc_widget_value (); - prev_wv->value = (char *) pane_string; - prev_wv->enabled = 1; - prev_wv->name = "message"; - prev_wv->help = Qnil; + prev_wv = make_widget_value ("message", (char *) pane_string, true, Qnil); first_wv = prev_wv; /* Loop over all panes and items, filling in the tree. */ @@ -1907,15 +1869,13 @@ return Qnil; } - wv = xmalloc_widget_value (); + wv = make_widget_value (button_names[nb_buttons], + SSDATA (item_name), + !NILP (enable), Qnil); prev_wv->next = wv; - wv->name = (char *) button_names[nb_buttons]; if (!NILP (descrip)) wv->key = SSDATA (descrip); - wv->value = SSDATA (item_name); wv->call_data = aref_addr (menu_items, i); - wv->enabled = !NILP (enable); - wv->help = Qnil; prev_wv = wv; if (! boundary_seen) @@ -1930,9 +1890,7 @@ if (! boundary_seen) left_count = nb_buttons - nb_buttons / 2; - wv = xmalloc_widget_value (); - wv->name = dialog_name; - wv->help = Qnil; + wv = make_widget_value (dialog_name, NULL, false, Qnil); /* Frame title: 'Q' = Question, 'I' = Information. Can also have 'E' = Error if, one day, we want === modified file 'src/xterm.h' --- src/xterm.h 2014-05-28 13:53:22 +0000 +++ src/xterm.h 2014-06-02 18:01:21 +0000 @@ -47,7 +47,6 @@ /* Some definitions to reduce conditionals. */ typedef GtkWidget *xt_or_gtk_widget; -#define XtParent(x) (gtk_widget_get_parent (x)) #undef XSync #define XSync(d, b) do { gdk_window_process_all_updates (); \ XSync (d, b); } while (false) ------------------------------------------------------------ revno: 117238 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-06-02 21:55:38 +0400 message: * image.c (x_query_frame_background_color) [HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG]: Fix --enable-gcc-warnings compilation without image libraries. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-02 17:08:50 +0000 +++ src/ChangeLog 2014-06-02 17:55:38 +0000 @@ -1,3 +1,9 @@ +2014-06-02 Dmitry Antipov + + * image.c (x_query_frame_background_color) + [HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG]: + Fix --enable-gcc-warnings compilation without image libraries. + 2014-06-02 Eli Zaretskii * w32heap.c (malloc_after_dump, realloc_after_dump): Update the === modified file 'src/image.c' --- src/image.c 2014-05-27 17:31:17 +0000 +++ src/image.c 2014-06-02 17:55:38 +0000 @@ -1236,6 +1236,9 @@ return img->background_transparent; } +#if defined (HAVE_PNG) || defined (HAVE_NS) \ + || defined (HAVE_IMAGEMAGICK) || defined (HAVE_RSVG) + /* Store F's background color into *BGCOLOR. */ static void x_query_frame_background_color (struct frame *f, XColor *bgcolor) @@ -1248,7 +1251,8 @@ #endif } - +#endif /* HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG */ + /*********************************************************************** Helper functions for X image types ***********************************************************************/ ------------------------------------------------------------ revno: 117237 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2014-06-02 20:19:19 +0300 message: src/w32heap.c (init_heap): Fix typos in comments (again). diff: === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-02 17:17:55 +0000 +++ src/w32heap.c 2014-06-02 17:19:19 +0000 @@ -201,7 +201,7 @@ /* Heap creation. */ -/* Under MinGW32, we want to turn on Low Fragmentation Heap for XP. +/* We want to turn on Low Fragmentation Heap for XP and older systems. MinGW32 lacks those definitions. */ #ifndef _W64 typedef enum _HEAP_INFORMATION_CLASS { @@ -234,8 +234,7 @@ heap = HeapCreate(0, 0, 0); #ifndef _W64 - /* Set the low-fragmentation heap for OS before XP and Windows - Server 2003. */ + /* Set the low-fragmentation heap for OS before Vista. */ HMODULE hm_kernel32dll = LoadLibrary("kernel32.dll"); HeapSetInformation_Proc s_pfn_Heap_Set_Information = (HeapSetInformation_Proc) GetProcAddress(hm_kernel32dll, "HeapSetInformation"); if (s_pfn_Heap_Set_Information != NULL) ------------------------------------------------------------ revno: 117236 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2014-06-02 20:17:55 +0300 message: src/w32heap.c (init_heap): Fix typos in comments. diff: === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-02 17:08:50 +0000 +++ src/w32heap.c 2014-06-02 17:17:55 +0000 @@ -219,9 +219,9 @@ unsigned long enable_lfh = 2; /* After dumping, use a new private heap. We explicitly enable - the low fragmentation heap here, for the sake of pre Vista - versions. Note: this will harnlessly fail on Vista and - later, whyere the low fragmentation heap is enabled by + the low fragmentation heap (LFH) here, for the sake of pre + Vista versions. Note: this will harmlessly fail on Vista and + later, where the low-fragmentation heap is enabled by default. It will also fail on pre-Vista versions when Emacs is run under a debugger; set _NO_DEBUG_HEAP=1 in the environment before starting GDB to get low fragmentation heap ------------------------------------------------------------ revno: 117235 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2014-06-02 20:08:50 +0300 message: Minor improvement of sbrk emulation on MS-Windows. src/w32heap.c (malloc_after_dump, realloc_after_dump): Update the emulated break value only if it goes up. (sbrk): Add assertion that the INCREMENT argument is strictly zero. Improve and correct the commentary. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-06-02 06:08:49 +0000 +++ src/ChangeLog 2014-06-02 17:08:50 +0000 @@ -1,3 +1,10 @@ +2014-06-02 Eli Zaretskii + + * w32heap.c (malloc_after_dump, realloc_after_dump): Update the + emulated break value only if it goes up. + (sbrk): Add assertion that the INCREMENT argument is strictly + zero. Improve and correct the commentary. + 2014-06-02 Paul Eggert Improve AIX-related merge from emacs-24. === modified file 'src/w32heap.c' --- src/w32heap.c 2014-06-01 15:54:56 +0000 +++ src/w32heap.c 2014-06-02 17:08:50 +0000 @@ -299,9 +299,14 @@ /* Use the new private heap. */ void *p = HeapAlloc (heap, 0, size); - /* After dump, keep track of the last allocated byte for sbrk(0). */ + /* After dump, keep track of the "brk value" for sbrk(0). */ if (p) - data_region_end = p + size - 1; + { + unsigned char *new_brk = (unsigned char *)p + size; + + if (new_brk > data_region_end) + data_region_end = new_brk; + } else errno = ENOMEM; return p; @@ -391,9 +396,14 @@ else errno = ENOMEM; } - /* After dump, keep track of the last allocated byte for sbrk(0). */ + /* After dump, keep track of the "brk value" for sbrk(0). */ if (p) - data_region_end = p + size - 1; + { + unsigned char *new_brk = (unsigned char *)p + size; + + if (new_brk > data_region_end) + data_region_end = new_brk; + } return p; } @@ -497,10 +507,11 @@ void * sbrk (ptrdiff_t increment) { - /* The data_region_end address is the one of the last byte - allocated. The sbrk() function is not emulated at all, except - for a 0 value of its parameter. This is needed by the emacs lisp - function `memory-limit'. */ + /* data_region_end is the address beyond the last allocated byte. + The sbrk() function is not emulated at all, except for a 0 value + of its parameter. This is needed by the Emacs Lisp function + `memory-limit'. */ + eassert (increment == 0); return data_region_end; } ------------------------------------------------------------ revno: 117234 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 17:17:39 +0200 message: * net/tramp.el (tramp-handle-unhandled-file-name-directory): Return "/". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 13:51:35 +0000 +++ lisp/ChangeLog 2014-06-02 15:17:39 +0000 @@ -2,6 +2,7 @@ * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): Add traces. + (tramp-handle-unhandled-file-name-directory): Return "/". 2014-06-02 Wilson Snyder === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 14:17:07 +0000 +++ lisp/net/tramp.el 2014-06-02 15:17:39 +0000 @@ -3340,8 +3340,9 @@ (defun tramp-handle-unhandled-file-name-directory (_filename) "Like `unhandled-file-name-directory' for Tramp files." ;; With Emacs 23, we could simply return `nil'. But we must keep it - ;; for backward compatibility. - (expand-file-name "~/")) + ;; for backward compatibility. "~/" cannot be returned, because + ;; there might be machines without a HOME directory (like hydra). + "/") (defun tramp-handle-set-visited-file-modtime (&optional time-list) "Like `set-visited-file-modtime' for Tramp files." ------------------------------------------------------------ revno: 117233 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 16:17:07 +0200 message: * net/tramp.el (with-tramp-progress-reporter): Complete previous patch. diff: === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 14:05:35 +0000 +++ lisp/net/tramp.el 2014-06-02 14:17:07 +0000 @@ -1676,7 +1676,10 @@ (prog1 (condition-case err (progn ,@body) - (error (tramp-message ,vec 6 "%s" (error-message-string err)))) + (error + (tramp-message ,vec 6 "%s" (error-message-string err)) + ;; Propagate the error. + (signal (car err) (cdr err)))) (setq cookie "done")) ;; Stop progress reporter. (if tm (tramp-compat-funcall 'cancel-timer tm)) ------------------------------------------------------------ revno: 117232 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 16:05:35 +0200 message: * net/tramp.el (with-tramp-progress-reporter): Add more traces. diff: === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 13:51:35 +0000 +++ lisp/net/tramp.el 2014-06-02 14:05:35 +0000 @@ -1673,7 +1673,11 @@ #'tramp-progress-reporter-update pr))))))) (unwind-protect ;; Execute the body. - (prog1 (progn ,@body) (setq cookie "done")) + (prog1 + (condition-case err + (progn ,@body) + (error (tramp-message ,vec 6 "%s" (error-message-string err)))) + (setq cookie "done")) ;; Stop progress reporter. (if tm (tramp-compat-funcall 'cancel-timer tm)) (tramp-message ,vec ,level "%s...%s" ,message cookie) ------------------------------------------------------------ revno: 117231 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 15:51:35 +0200 message: * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): Add traces. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 09:58:50 +0000 +++ lisp/ChangeLog 2014-06-02 13:51:35 +0000 @@ -1,6 +1,7 @@ 2014-06-02 Michael Albinus - * net/tramp.el (tramp-call-process): Add traces. + * net/tramp.el (with-tramp-progress-reporter, tramp-call-process): + Add traces. 2014-06-02 Wilson Snyder === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 11:35:40 +0000 +++ lisp/net/tramp.el 2014-06-02 13:51:35 +0000 @@ -1676,7 +1676,8 @@ (prog1 (progn ,@body) (setq cookie "done")) ;; Stop progress reporter. (if tm (tramp-compat-funcall 'cancel-timer tm)) - (tramp-message ,vec ,level "%s...%s" ,message cookie))))) + (tramp-message ,vec ,level "%s...%s" ,message cookie) + (when (string-equal "failed" cookie) (tramp-backtrace ,vec)))))) (tramp-compat-font-lock-add-keywords 'emacs-lisp-mode '("\\")) @@ -4128,13 +4129,17 @@ (tramp-message v 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) - (with-temp-buffer - (setq result - (apply - 'call-process program infile (or destination t) display args)) - (with-current-buffer - (if (bufferp destination) destination (current-buffer)) - (tramp-message v 6 "%d\n%s" result (buffer-string)))) + (condition-case err + (with-temp-buffer + (setq result + (apply + 'call-process program infile (or destination t) display args)) + (with-current-buffer + (if (bufferp destination) destination (current-buffer)) + (tramp-message v 6 "%d\n%s" result (buffer-string)))) + (error + (setq result 1) + (tramp-message v 6 "%d\n%s" result (error-message-string err)))) result)) ;;;###tramp-autoload ------------------------------------------------------------ revno: 117230 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 13:35:40 +0200 message: * net/tramp.el (tramp-call-process): Add more traces. diff: === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-06-02 09:58:50 +0000 +++ lisp/net/tramp.el 2014-06-02 11:35:40 +0000 @@ -4124,18 +4124,17 @@ Furthermore, traces are written with verbosity of 6." (let ((v (vector tramp-current-method tramp-current-user tramp-current-host nil nil)) - (result 1)) + result) (tramp-message v 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) - (when (executable-find program) - (with-temp-buffer - (setq result - (apply - 'call-process program infile (or destination t) display args)) - (with-current-buffer - (if (bufferp destination) destination (current-buffer)) - (tramp-message v 6 "%d\n%s" result (buffer-string))))) + (with-temp-buffer + (setq result + (apply + 'call-process program infile (or destination t) display args)) + (with-current-buffer + (if (bufferp destination) destination (current-buffer)) + (tramp-message v 6 "%d\n%s" result (buffer-string)))) result)) ;;;###tramp-autoload ------------------------------------------------------------ revno: 117229 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 11:58:50 +0200 message: * lisp/net/tramp.el (tramp-call-process): Add traces. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 06:45:11 +0000 +++ lisp/ChangeLog 2014-06-02 09:58:50 +0000 @@ -1,3 +1,7 @@ +2014-06-02 Michael Albinus + + * net/tramp.el (tramp-call-process): Add traces. + 2014-06-02 Wilson Snyder Sync with upstream verilog-mode revision 3cd8144. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-04-18 18:57:04 +0000 +++ lisp/net/tramp.el 2014-06-02 09:58:50 +0000 @@ -4122,12 +4122,21 @@ defadvised `call-process' to behave like `process-file'. The Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6." - (tramp-message - (vector tramp-current-method tramp-current-user tramp-current-host nil nil) - 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) - (if (executable-find program) - (apply 'call-process program infile destination display args) - 1)) + (let ((v (vector tramp-current-method tramp-current-user tramp-current-host + nil nil)) + (result 1)) + (tramp-message + v 6 "`%s %s' %s %s" + program (mapconcat 'identity args " ") infile destination) + (when (executable-find program) + (with-temp-buffer + (setq result + (apply + 'call-process program infile (or destination t) display args)) + (with-current-buffer + (if (bufferp destination) destination (current-buffer)) + (tramp-message v 6 "%d\n%s" result (buffer-string))))) + result)) ;;;###tramp-autoload (defun tramp-read-passwd (proc &optional prompt) ------------------------------------------------------------ revno: 117228 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-06-02 11:53:43 +0200 message: * test/automated/tramp-tests.el (tramp-remote-process-environment): Declare. (tramp-test29-vc-registered): Set $BZR_HOME. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-06-02 00:18:22 +0000 +++ test/ChangeLog 2014-06-02 09:53:43 +0000 @@ -1,3 +1,8 @@ +2014-06-02 Michael Albinus + + * automated/tramp-tests.el (tramp-remote-process-environment): Declare. + (tramp-test29-vc-registered): Set $BZR_HOME. + 2014-06-01 Michael Albinus * automated/tramp-tests.el (tramp-test29-vc-registered): === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2014-06-02 00:18:22 +0000 +++ test/automated/tramp-tests.el 2014-06-02 09:53:43 +0000 @@ -47,6 +47,7 @@ (declare-function tramp-find-executable "tramp-sh") (declare-function tramp-get-remote-path "tramp-sh") (defvar tramp-copy-size-limit) +(defvar tramp-remote-process-environment) ;; There is no default value on w32 systems, which could work out of the box. (defconst tramp-test-temporary-file-directory @@ -1398,10 +1399,19 @@ (let* ((default-directory tramp-test-temporary-file-directory) (tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (expand-file-name "foo" tmp-name1)) + (tramp-remote-process-environment tramp-remote-process-environment) (vc-handled-backends (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil (cond ((tramp-find-executable v vc-bzr-program (tramp-get-remote-path v)) + (setq tramp-remote-process-environment + (cons (format "BZR_HOME=%s" + (file-remote-p tmp-name1 'localname)) + tramp-remote-process-environment)) + ;; We must force a reconnect, in order to activate $BZR_HOME. + (tramp-cleanup-connection + (tramp-dissect-file-name tramp-test-temporary-file-directory) + nil 'keep-password) '(Bzr)) ((tramp-find-executable v vc-git-program (tramp-get-remote-path v)) '(Git)) ------------------------------------------------------------ revno: 117227 author: Wilson Snyder committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-06-01 23:45:11 -0700 message: Sync with upstream verilog-mode revision 3cd8144 * lisp/progmodes/verilog-mode.el (verilog-mode-version): Bump. (verilog-auto-arg-format): New option, to support newlines in AUTOARG. (verilog-type-font-keywords): Add nor. (verilog-batch-execute-func): Force reading of Local Variables. Fix printing "no changes to be saved" with verilog-batch. (verilog-auto-arg-ports): Doc fix. Add verilog-auto-arg-format to support newlines in AUTOARG. (verilog-auto-arg): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-06-02 01:10:07 +0000 +++ lisp/ChangeLog 2014-06-02 06:45:11 +0000 @@ -1,3 +1,15 @@ +2014-06-02 Wilson Snyder + + Sync with upstream verilog-mode revision 3cd8144. + * progmodes/verilog-mode.el (verilog-mode-version): Bump. + (verilog-auto-arg-format): New option, to support newlines in AUTOARG. + (verilog-type-font-keywords): Add nor. + (verilog-batch-execute-func): Force reading of Local Variables. + Fix printing "no changes to be saved" with verilog-batch. + (verilog-auto-arg-ports): Doc fix. + Add verilog-auto-arg-format to support newlines in AUTOARG. + (verilog-auto-arg): Doc fix. + 2014-06-02 Glenn Morris * emulation/crisp.el, emulation/tpu-edt.el, emulation/tpu-extras.el: === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2014-05-29 03:45:29 +0000 +++ lisp/progmodes/verilog-mode.el 2014-06-02 06:45:11 +0000 @@ -123,7 +123,7 @@ ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2014-03-15-702457d-vpo" +(defconst verilog-mode-version "2014-05-31-3cd8144-vpo" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -1020,6 +1020,20 @@ :type 'string) (put 'verilog-assignment-delay 'safe-local-variable 'stringp) +(defcustom verilog-auto-arg-format 'packed + "Formatting to use for AUTOARG signal names. +If 'packed', then as many inputs and outputs that fit within +`fill-column' will be put onto one line. + +If 'single', then a single input or output will be put onto each +line." + :version "24.5" + :type '(radio (const :tag "Line up Assignments and Declarations" packed) + (const :tag "Line up Assignment statements" single)) + :group 'verilog-mode-auto) +(put 'verilog-auto-arg-format 'safe-local-variable + '(lambda (x) (memq x '(packed single)))) + (defcustom verilog-auto-arg-sort nil "Non-nil means AUTOARG signal names will be sorted, not in declaration order. Declaration order is advantageous with order based instantiations @@ -2907,7 +2921,7 @@ '( "and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam" "event" "genvar" "inout" "input" "integer" "localparam" - "logic" "mailbox" "nand" "nmos" "not" "notif0" "notif1" "or" + "logic" "mailbox" "nand" "nmos" "nor" "not" "notif0" "notif1" "or" "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup" "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran" "rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply" @@ -5144,23 +5158,29 @@ ;; Make sure any sub-files we read get proper mode (setq-default major-mode 'verilog-mode) ;; Ditto files already read in - (mapc (lambda (buf) - (when (buffer-file-name buf) - (with-current-buffer buf - (verilog-mode)))) - (buffer-list)) - ;; Process the files - (mapcar (lambda (buf) + ;; Remember buffer list, so don't later pickup any verilog-getopt files + (let ((orig-buffer-list (buffer-list))) + (mapc (lambda (buf) (when (buffer-file-name buf) - (save-excursion - (if (not (file-exists-p (buffer-file-name buf))) - (error - (concat "File not found: " (buffer-file-name buf)))) - (message (concat "Processing " (buffer-file-name buf))) - (set-buffer buf) - (funcall funref) - (unless no-save (save-buffer))))) - (buffer-list)))) + (with-current-buffer buf + (verilog-mode) + (verilog-auto-reeval-locals) + (verilog-getopt-flags)))) + orig-buffer-list) + ;; Process the files + (mapcar (lambda (buf) + (when (buffer-file-name buf) + (save-excursion + (if (not (file-exists-p (buffer-file-name buf))) + (error + (concat "File not found: " (buffer-file-name buf)))) + (message (concat "Processing " (buffer-file-name buf))) + (set-buffer buf) + (funcall funref) + (when (and (not no-save) + (buffer-modified-p)) ;; Avoid "no changes to be saved" + (save-buffer))))) + orig-buffer-list)))) (defun verilog-batch-auto () "For use with --batch, perform automatic expansions as a stand-alone tool. @@ -9639,7 +9659,7 @@ allow-cache (setq modi (gethash module verilog-modi-lookup-cache)) (equal verilog-modi-lookup-last-current current) - ;; Iff hit is in current buffer, then tick must match + ;; If hit is in current buffer, then tick must match (or (equal verilog-modi-lookup-last-tick (buffer-chars-modified-tick)) (not (equal current (verilog-modi-file-or-buffer modi))))) ;;(message "verilog-modi-lookup: HIT %S" modi) @@ -10617,7 +10637,7 @@ ;; (defun verilog-auto-arg-ports (sigs message indent-pt) - "Print a list of ports for an AUTOINST. + "Print a list of ports for AUTOARG. Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT." (when sigs (when verilog-auto-arg-sort @@ -10629,13 +10649,19 @@ (let ((space "")) (indent-to indent-pt) (while sigs - (cond ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column) + (cond ((equal verilog-auto-arg-format 'single) + (indent-to indent-pt) + (setq space "\n")) + ;; verilog-auto-arg-format 'packed + ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column) (insert "\n") - (indent-to indent-pt)) - (t (insert space))) + (indent-to indent-pt) + (setq space " ")) + (t + (insert space) + (setq space " "))) (insert (verilog-sig-name (car sigs)) ",") - (setq sigs (cdr sigs) - space " "))))) + (setq sigs (cdr sigs)))))) (defun verilog-auto-arg () "Expand AUTOARG statements. @@ -10670,9 +10696,11 @@ output o; endmodule -The argument declarations may be printed in declaration order to best suit -order based instantiations, or alphabetically, based on the -`verilog-auto-arg-sort' variable. +The argument declarations may be printed in declaration order to +best suit order based instantiations, or alphabetically, based on +the `verilog-auto-arg-sort' variable. + +Formatting is controlled with `verilog-auto-arg-format' variable. Any ports declared between the ( and /*AUTOARG*/ are presumed to be predeclared and are not redeclared by AUTOARG. AUTOARG will make a