Index: emacs/src/macmenu.c diff -c emacs/src/macmenu.c:1.26 emacs/src/macmenu.c:1.27 *** emacs/src/macmenu.c:1.26 Tue May 24 08:45:35 2005 --- emacs/src/macmenu.c Sat Jun 4 08:06:57 2005 *************** *** 602,607 **** --- 602,614 ---- } } + static Lisp_Object + cleanup_popup_menu (arg) + Lisp_Object arg; + { + discard_menu_items (); + } + DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, doc: /* Pop up a deck-of-cards menu and return user's selection. POSITION is a position specification. This is either a mouse button *************** *** 647,652 **** --- 654,661 ---- int keymaps = 0; int for_click = 0; struct gcpro gcpro1; + int specpdl_count = SPECPDL_INDEX (); + #ifdef HAVE_MENUS if (! NILP (position)) *************** *** 806,818 **** #ifdef HAVE_MENUS /* Display them in a menu. */ BLOCK_INPUT; selection = mac_menu_show (f, xpos, ypos, for_click, keymaps, title, &error_name); UNBLOCK_INPUT; ! ! discard_menu_items (); UNGCPRO; #endif /* HAVE_MENUS */ --- 815,827 ---- #ifdef HAVE_MENUS /* Display them in a menu. */ + record_unwind_protect (cleanup_popup_menu, Qnil); BLOCK_INPUT; selection = mac_menu_show (f, xpos, ypos, for_click, keymaps, title, &error_name); UNBLOCK_INPUT; ! unbind_to (specpdl_count, Qnil); UNGCPRO; #endif /* HAVE_MENUS */ *************** *** 1931,1936 **** --- 1940,1948 ---- } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; }
_______________________________________________ Emacs-diffs mailing list Emacs-diffs@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-diffs