unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sebastian Miele <iota@whxvd.name>
Cc: 54329@debbugs.gnu.org
Subject: bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
Date: Thu, 10 Mar 2022 19:09:49 +0200	[thread overview]
Message-ID: <835yolentu.fsf@gnu.org> (raw)
In-Reply-To: <878rthhjae.fsf@whxvd.name> (message from Sebastian Miele on Thu,  10 Mar 2022 17:19:07 +0100)

> From: Sebastian Miele <iota@whxvd.name>
> Date: Thu, 10 Mar 2022 17:19:07 +0100
> 
> In an emacs -Q, evaluate
> 
>   (add-hook 'kill-emacs-query-functions
>             'custom-prompt-customize-unsaved-options)
> 
>   (progn
>     ;; Somthing like the following may be done, e.g., by
>     ;; ‘activate-transient-input-method’:
>     (setq default-transient-input-method "TeX")
>     (customize-mark-as-set 'default-transient-input-method))
> 
> and hit C-x C-c.  When asked about whether to examine the unsaved
> options, say yes.
> 
> Expected: Emacs does not terminate, so that I can examine.
> 
> Actual behavior: Emacs terminates.
> 
> The following diff fixes this issue (and a documentation bug):
> 
> diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
> index c2ddaeb7b1..77840c4b65 100644
> --- a/lisp/cus-edit.el
> +++ b/lisp/cus-edit.el
> @@ -1531,12 +1531,11 @@ customize-apropos-groups
>  ;;;###autoload
>  (defun custom-prompt-customize-unsaved-options ()
>    "Prompt user to customize any unsaved customization options.
> -Return non-nil if user chooses to customize, for use in
> +Return nil if user chooses to customize, for use in

If you want to prevent Emacs from terminating, you can simply return
nil from your hook function.  I see no reason to change the semantics
of the return value for a single use case: this function was evidently
assuming a different use case, and it exists in this shape long enough
to prevent us to change its behavior in such a radical way.

Thanks.





  reply	other threads:[~2022-03-10 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 16:19 bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil Sebastian Miele
2022-03-10 17:09 ` Eli Zaretskii [this message]
2022-03-10 17:17   ` Sebastian Miele
2022-03-10 18:29     ` Eli Zaretskii
2022-03-10 18:55       ` Sebastian Miele
2022-03-10 19:55         ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=835yolentu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54329@debbugs.gnu.org \
    --cc=iota@whxvd.name \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).