all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63655@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	[thread overview]
Message-ID: <87353nw5l3.fsf@yahoo.com> (raw)
In-Reply-To: <831qj7p5i6.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 23 May 2023 16:00:17 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: 63655@debbugs.gnu.org
>> Date: Tue, 23 May 2023 20:07:58 +0800
>> 
>> Eli Zaretskii <eliz@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.





  reply	other threads:[~2023-05-23 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87lehfwrzt.fsf.ref@yahoo.com>
2023-05-23  5:12 ` bug#63655: 29.0.91; Dialog box not displayed upon closing frame Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-23 11:14   ` Eli Zaretskii
2023-05-23 12:07     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-23 13:00       ` Eli Zaretskii
2023-05-23 13:16         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-05-23 14:48           ` Eli Zaretskii
2023-05-24  0:18             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-24  2:31               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87353nw5l3.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=63655@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.