diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/ChangeLog emacs-snapshot-201406031736~ubuntu12.10.1/ChangeLog --- emacs-snapshot-201406021735~ubuntu12.10.1/ChangeLog 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/ChangeLog 2014-06-03 17:36:13.000000000 +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). diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/configure.ac emacs-snapshot-201406031736~ubuntu12.10.1/configure.ac --- emacs-snapshot-201406021735~ubuntu12.10.1/configure.ac 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/configure.ac 2014-06-03 17:36:13.000000000 +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.]) diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/debian/bzr-builder.manifest emacs-snapshot-201406031736~ubuntu12.10.1/debian/bzr-builder.manifest --- emacs-snapshot-201406021735~ubuntu12.10.1/debian/bzr-builder.manifest 2014-06-02 17:54:09.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/debian/bzr-builder.manifest 2014-06-03 17:54:57.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version 2:201406021735 -lp:emacs revid:michael.albinus@gmx.de-20140602113540-62kmuoznodmv94kd +# bzr-builder format 0.3 deb-version 2:201406031736 +lp:emacs revid:eliz@gnu.org-20140603100108-vh6cr3olla8c3t9a merge packaging lp:~ubuntu-elisp/emacs/snapshot-packaging revid:robert.park@canonical.com-20130510084312-lfmcbl0dmcdw4y6s diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/debian/changelog emacs-snapshot-201406031736~ubuntu12.10.1/debian/changelog --- emacs-snapshot-201406021735~ubuntu12.10.1/debian/changelog 2014-06-02 17:54:09.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/debian/changelog 2014-06-03 17:54:57.000000000 +0000 @@ -1,8 +1,8 @@ -emacs-snapshot (2:201406021735~ubuntu12.10.1) quantal; urgency=low +emacs-snapshot (2:201406031736~ubuntu12.10.1) quantal; urgency=low * Auto build. - -- Ubuntu Emacs Lisp Mon, 02 Jun 2014 17:54:09 +0000 + -- Ubuntu Emacs Lisp Tue, 03 Jun 2014 17:54:57 +0000 emacs-snapshot (0-0ubuntu1) UNRELEASED; urgency=low diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lisp/ChangeLog emacs-snapshot-201406031736~ubuntu12.10.1/lisp/ChangeLog --- emacs-snapshot-201406021735~ubuntu12.10.1/lisp/ChangeLog 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lisp/ChangeLog 2014-06-03 17:36:13.000000000 +0000 @@ -1,6 +1,18 @@ +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... + (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. + (tramp-handle-unhandled-file-name-directory): Return "/". 2014-06-02 Wilson Snyder diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lisp/menu-bar.el emacs-snapshot-201406031736~ubuntu12.10.1/lisp/menu-bar.el --- emacs-snapshot-201406021735~ubuntu12.10.1/lisp/menu-bar.el 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lisp/menu-bar.el 2014-06-03 17:36:13.000000000 +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)) diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lisp/net/tramp.el emacs-snapshot-201406031736~ubuntu12.10.1/lisp/net/tramp.el --- emacs-snapshot-201406021735~ubuntu12.10.1/lisp/net/tramp.el 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lisp/net/tramp.el 2014-06-03 17:36:13.000000000 +0000 @@ -3332,8 +3332,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." @@ -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 diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lisp/register.el emacs-snapshot-201406031736~ubuntu12.10.1/lisp/register.el --- emacs-snapshot-201406021735~ubuntu12.10.1/lisp/register.el 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lisp/register.el 2014-06-03 17:36:13.000000000 +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)) diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/ChangeLog emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/ChangeLog --- emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/ChangeLog 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/ChangeLog 2014-06-03 17:36:13.000000000 +0000 @@ -1,3 +1,18 @@ +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. + * 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. diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/lwlib.c emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/lwlib.c --- emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/lwlib.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/lwlib.c 2014-06-03 17:36:13.000000000 +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; diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/lwlib.h emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/lwlib.h --- emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/lwlib.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/lwlib.h 2014-06-03 17:36:13.000000000 +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. */ diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/xlwmenu.c emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/xlwmenu.c --- emacs-snapshot-201406021735~ubuntu12.10.1/lwlib/xlwmenu.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/lwlib/xlwmenu.c 2014-06-03 17:36:13.000000000 +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) diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/ChangeLog emacs-snapshot-201406031736~ubuntu12.10.1/src/ChangeLog --- emacs-snapshot-201406021735~ubuntu12.10.1/src/ChangeLog 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/ChangeLog 2014-06-03 17:36:13.000000000 +0000 @@ -1,3 +1,58 @@ +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. + (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). + + 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 + of p->infd against zero. Add easserts for infd having a plausible + value. + +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. + +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. diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/gtkutil.c emacs-snapshot-201406031736~ubuntu12.10.1/src/gtkutil.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/gtkutil.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/gtkutil.c 2014-06-03 17:36:13.000000000 +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. */ diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/gtkutil.h emacs-snapshot-201406031736~ubuntu12.10.1/src/gtkutil.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/gtkutil.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/gtkutil.h 2014-06-03 17:36:13.000000000 +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, diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/image.c emacs-snapshot-201406031736~ubuntu12.10.1/src/image.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/image.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/image.c 2014-06-03 17:36:13.000000000 +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 ***********************************************************************/ diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/keyboard.h emacs-snapshot-201406031736~ubuntu12.10.1/src/keyboard.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/keyboard.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/keyboard.h 2014-06-03 17:36:13.000000000 +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). */ diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/Makefile.in emacs-snapshot-201406031736~ubuntu12.10.1/src/Makefile.in --- emacs-snapshot-201406021735~ubuntu12.10.1/src/Makefile.in 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/Makefile.in 2014-06-03 17:36:13.000000000 +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) \ diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/menu.c emacs-snapshot-201406031736~ubuntu12.10.1/src/menu.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/menu.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/menu.c 2014-06-03 17:36:13.000000000 +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; } diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/menu.h emacs-snapshot-201406031736~ubuntu12.10.1/src/menu.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/menu.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/menu.h 2014-06-03 17:36:13.000000000 +0000 @@ -20,8 +20,52 @@ #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 #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 @@ -41,7 +85,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 diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/nsgui.h emacs-snapshot-201406031736~ubuntu12.10.1/src/nsgui.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/nsgui.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/nsgui.h 2014-06-03 17:36:13.000000000 +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 { diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/nsmenu.m emacs-snapshot-201406031736~ubuntu12.10.1/src/nsmenu.m --- emacs-snapshot-201406021735~ubuntu12.10.1/src/nsmenu.m 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/nsmenu.m 2014-06-03 17:36:13.000000000 +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; } diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/process.c emacs-snapshot-201406031736~ubuntu12.10.1/src/process.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/process.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/process.c 2014-06-03 17:36:13.000000000 +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); } diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/w32gui.h emacs-snapshot-201406031736~ubuntu12.10.1/src/w32gui.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/w32gui.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/w32gui.h 2014-06-03 17:36:13.000000000 +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 { diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/w32heap.c emacs-snapshot-201406031736~ubuntu12.10.1/src/w32heap.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/w32heap.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/w32heap.c 2014-06-03 17:36:13.000000000 +0000 @@ -108,11 +108,21 @@ 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 -/* Info for managing our preload heap, which is essentially a fixed size - data area in the executable. */ -/* Info for keeping track of our heap. */ +static unsigned char dumped_data[DUMPED_HEAP_SIZE]; + +/* 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; @@ -143,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) @@ -201,7 +213,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 { @@ -219,9 +231,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 @@ -234,8 +246,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) @@ -285,7 +296,6 @@ #undef malloc #undef realloc -#undef calloc #undef free /* FREEABLE_P checks if the block can be safely freed. */ @@ -299,9 +309,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 +406,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 +517,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; } diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/w32heap.h emacs-snapshot-201406031736~ubuntu12.10.1/src/w32heap.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/w32heap.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/w32heap.h 2014-06-03 17:36:13.000000000 +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; diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/w32menu.c emacs-snapshot-201406031736~ubuntu12.10.1/src/w32menu.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/w32menu.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/w32menu.c 2014-06-03 17:36:13.000000000 +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 (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; /* 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 diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/xmenu.c emacs-snapshot-201406031736~ubuntu12.10.1/src/xmenu.c --- emacs-snapshot-201406021735~ubuntu12.10.1/src/xmenu.c 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/xmenu.c 2014-06-03 17:36:13.000000000 +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 diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/src/xterm.h emacs-snapshot-201406031736~ubuntu12.10.1/src/xterm.h --- emacs-snapshot-201406021735~ubuntu12.10.1/src/xterm.h 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/src/xterm.h 2014-06-03 17:36:13.000000000 +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) diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/test/automated/tramp-tests.el emacs-snapshot-201406031736~ubuntu12.10.1/test/automated/tramp-tests.el --- emacs-snapshot-201406021735~ubuntu12.10.1/test/automated/tramp-tests.el 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/test/automated/tramp-tests.el 2014-06-03 17:36:13.000000000 +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." diff -Nru emacs-snapshot-201406021735~ubuntu12.10.1/test/ChangeLog emacs-snapshot-201406031736~ubuntu12.10.1/test/ChangeLog --- emacs-snapshot-201406021735~ubuntu12.10.1/test/ChangeLog 2014-06-02 17:35:56.000000000 +0000 +++ emacs-snapshot-201406031736~ubuntu12.10.1/test/ChangeLog 2014-06-03 17:36:13.000000000 +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