Richard Stallman wrote: I think that assumption is not true. From reading the code, x-popup-dialog ALWAYS quits if the user doesn't make a valid choice.
That is good, since it gives a lot more consistent behavior. What about the following patches, which take this into account? ===File ~/lispref-frames.texi-diff-2======================== *** frames.texi 01 May 2005 16:35:35 -0500 1.86 --- frames.texi 04 May 2005 17:16:03 -0500 *************** *** 1402,1407 **** --- 1402,1414 ---- where @var{line} is a string, and @var{value} is the value to return if that @var{line} is chosen. An item can also be a string; this makes a non-selectable line in the menu. + + If the user gets rid of the menu without making a valid choice, for + instance by clicking the mouse away from a valid choice or by typing + keyboard input, then this normally results in a quit and + @code{x-popup-menu} returns no value. But if @var{position} is a + mouse button event (indicating that the user invoked the menu with the + mouse) then no quit occurs and @code{x-popup-menu} returns @code{nil}. @end defun @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu *************** *** 1470,1475 **** --- 1477,1486 ---- In some configurations, Emacs cannot display a real dialog box; so instead it displays the same items in a pop-up menu in the center of the frame. + + If the user gets rid of the dialog box without making a valid choice, + for instance using the window manager, then this produces a quit and + @code{x-popup-dialog} returns no value. @end defun @node Pointer Shapes ============================================================ ===File ~/xmenu.c-diff-2==================================== *** xmenu.c 01 May 2005 16:37:06 -0500 1.287 --- xmenu.c 04 May 2005 21:43:24 -0500 *************** *** 767,773 **** With this form of menu, the return value is VALUE from the chosen item. If POSITION is nil, don't display the menu at all, just precalculate the ! cached information about equivalent key sequences. */) (position, menu) Lisp_Object position, menu; { --- 767,780 ---- With this form of menu, the return value is VALUE from the chosen item. If POSITION is nil, don't display the menu at all, just precalculate the ! cached information about equivalent key sequences. ! ! If the user gets rid of the menu without making a valid choice, for ! instance by clicking the mouse away from a valid choice or by typing ! keyboard input, then this normally results in a quit and ! `x-popup-menu' returns no value. But if POSITION is a mouse button ! event (indicating that the user invoked the menu with the mouse) then ! no quit occurs and `x-popup-menu' returns nil. */) (position, menu) Lisp_Object position, menu; { *************** *** 1005,1011 **** An ITEM may also be just a string--that makes a nonselectable item. An ITEM may also be nil--that means to put all preceding items on the left of the dialog box and all following items on the right. ! \(By default, approximately half appear on each side.) */) (position, contents) Lisp_Object position, contents; { --- 1012,1022 ---- An ITEM may also be just a string--that makes a nonselectable item. An ITEM may also be nil--that means to put all preceding items on the left of the dialog box and all following items on the right. ! \(By default, approximately half appear on each side.) ! ! If the user gets rid of the dialog box without making a valid choice, ! for instance using the window manager, then this produces a quit and ! `x-popup-dialog' returns no value. */) (position, contents) Lisp_Object position, contents; { ============================================================ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel