GNU bug report logs - #54329
28.0.91; custom-prompt-customize-unsaved-options does not return nil

Previous Next

Package: emacs;

Reported by: Sebastian Miele <iota <at> whxvd.name>

Date: Thu, 10 Mar 2022 16:34:02 UTC

Severity: normal

Found in version 28.0.91

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

Bug is archived. No further changes may be made.

Full log


Message #8 received at 54329 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sebastian Miele <iota <at> whxvd.name>
Cc: 54329 <at> debbugs.gnu.org
Subject: Re: bug#54329: 28.0.91;
 custom-prompt-customize-unsaved-options does not return nil
Date: Thu, 10 Mar 2022 19:09:49 +0200
> From: Sebastian Miele <iota <at> 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.




This bug report was last modified 3 years and 155 days ago.

Previous Next


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