GNU bug report logs - #63655
29.0.91; Dialog box not displayed upon closing frame

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Tue, 23 May 2023 05:13:02 UTC

Severity: normal

Found in version 29.0.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 63655 <at> debbugs.gnu.org
Subject: bug#63655: 29.0.91; Dialog box not displayed upon closing frame
Date: Tue, 23 May 2023 21:16:40 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Po Lu <luangruo <at> yahoo.com>
>> Cc: 63655 <at> debbugs.gnu.org
>> Date: Tue, 23 May 2023 20:07:58 +0800
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >>   Really exit Emacs? (y or n)
>> >
>> > confirm-kill-emacs, if non-nil, should be a function.  If I try what
>> > you described above, Emacs signals an error when I close the last
>> > frame.
>> 
>> Sorry, I meant to set it to `y-or-n-p'.  I did that from Custom.
>
> Does the patch below give good results?
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 52227b5..9aa28d9 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -3544,6 +3544,8 @@ use-dialog-box-p
>    "Return non-nil if the current command should prompt the user via a dialog box."
>    (and last-input-event                 ; not during startup
>         (or (consp last-nonmenu-event)   ; invoked by a mouse event
> +           (and (null last-nonmenu-event)
> +                (consp last-input-event))
>             from--tty-menu-p)            ; invoked via TTY menu
>         use-dialog-box))
>  
> diff --git a/src/fns.c b/src/fns.c
> index e8cd621..e01739c 100644
> --- a/src/fns.c
> +++ b/src/fns.c
> @@ -3193,8 +3193,11 @@ DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0,
>  
>    CHECK_STRING (prompt);
>  
> -  if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
> -      && use_dialog_box && ! NILP (last_input_event))
> +  if (!NILP (last_input_event)
> +      && (CONSP (last_nonmenu_event)
> +	  || (NILP (last_nonmenu_event) && CONSP (last_input_event))
> +	  || !NILP (find_symbol_value (Qfrom__tty_menu_p)))
> +      && use_dialog_box)
>      {
>        Lisp_Object pane, menu, obj;
>        redisplay_preserve_echo_area (4);
> @@ -6358,4 +6361,5 @@ syms_of_fns (void)
>    defsubr (&Sbuffer_line_statistics);
>  
>    DEFSYM (Qreal_this_command, "real-this-command");
> +  DEFSYM (Qfrom__tty_menu_p, "from--tty-menu-p");
>  }

Yes, it does.  Thanks.

BTW, could we please not change yes-or-no-p on the release branch?  It's
not involved in y-or-n-p, and doing so makes me skittish for a reason
you can surely understand.




This bug report was last modified 1 year and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.