aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2023-05-23 17:44:23 +0300
committerEli Zaretskii2023-05-23 17:44:23 +0300
commit5aadb87d6f6e3d9d755d4b6f6d124040c1bcfeee (patch)
treeefaecc837f55fdd1be6a87782e12642b17496e46 /src
parent0abb79ca09a9d0118e2bae7a4d00cd8f8a537795 (diff)
downloademacs-5aadb87d6f6e3d9d755d4b6f6d124040c1bcfeee.tar.gz
emacs-5aadb87d6f6e3d9d755d4b6f6d124040c1bcfeee.zip
Fix 'use-dialog-box-p' and friends
* lisp/subr.el (use-dialog-box-p): Use dialog boxes also when invoked from some window-system gesture. (Bug#63655) (y-or-n-p): Fix the description in the doc string of conditions under which a dialog box will be used. * src/fns.c (Fyes_or_no_p): Use the same condition for dialog boxes as in 'use-dialog-box-p'. Fix the description in the doc string of conditions under which a dialog box will be used. * doc/lispref/minibuf.texi (Multiple Queries, Yes-or-No Queries): Fix the description of conditions under which a dialog box will be used.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/fns.c b/src/fns.c
index e8cd6211d6d..2ed62d6e8c6 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3185,16 +3185,21 @@ has been confirmed.
3185If the `use-short-answers' variable is non-nil, instead of asking for 3185If the `use-short-answers' variable is non-nil, instead of asking for
3186\"yes\" or \"no\", this function will ask for \"y\" or \"n\". 3186\"yes\" or \"no\", this function will ask for \"y\" or \"n\".
3187 3187
3188If dialog boxes are supported, a dialog box will be used 3188If dialog boxes are supported, this function will use a dialog box
3189if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) 3189if `use-dialog-box' is non-nil and the last input event was produced
3190by a mouse, or by some window-system gesture, or via a menu. */)
3190 (Lisp_Object prompt) 3191 (Lisp_Object prompt)
3191{ 3192{
3192 Lisp_Object ans; 3193 Lisp_Object ans, val;
3193 3194
3194 CHECK_STRING (prompt); 3195 CHECK_STRING (prompt);
3195 3196
3196 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) 3197 if (!NILP (last_input_event)
3197 && use_dialog_box && ! NILP (last_input_event)) 3198 && (CONSP (last_nonmenu_event)
3199 || (NILP (last_nonmenu_event) && CONSP (last_input_event))
3200 || (val = find_symbol_value (Qfrom__tty_menu_p),
3201 (!NILP (val) && !EQ (val, Qunbound))))
3202 && use_dialog_box)
3198 { 3203 {
3199 Lisp_Object pane, menu, obj; 3204 Lisp_Object pane, menu, obj;
3200 redisplay_preserve_echo_area (4); 3205 redisplay_preserve_echo_area (4);
@@ -6358,4 +6363,5 @@ The same variable also affects the function `read-answer'. */);
6358 defsubr (&Sbuffer_line_statistics); 6363 defsubr (&Sbuffer_line_statistics);
6359 6364
6360 DEFSYM (Qreal_this_command, "real-this-command"); 6365 DEFSYM (Qreal_this_command, "real-this-command");
6366 DEFSYM (Qfrom__tty_menu_p, "from--tty-menu-p");
6361} 6367}