GNU bug report logs -
#54329
28.0.91; custom-prompt-customize-unsaved-options does not return nil
Previous Next
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
View this message in rfc822 format
Hi Eli,
Eli Zaretskii <eliz <at> gnu.org>:
> 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.
This is not about me wanting to change the behavior of
‘custom-prompt-customize-unsaved-options’. It definitely is a bug in
Emacs 28. The definition
(defun custom-prompt-customize-unsaved-options ()
(not (and (custom-unsaved-options)
(yes-or-no-p "Some customized options have not been saved; Examine? ")
(customize-unsaved)
t)))
seems to be unchanged from Emacs 27.2 to Emacs 28. However, in Emacs
27.2, it did work as I expect and as I understand the Emacs manual:
Please note that any customizations you have not chosen to save for
future sessions will be lost when you terminate Emacs. If you’d
like to be prompted about unsaved customizations at termination
time, add the following to your initialization file:
(add-hook 'kill-emacs-query-functions
'custom-prompt-customize-unsaved-options)
(For ‘custom-prompt-customize-unsaved-options’ to have a/the sensible
meaning as a member of ‘kill-emacs-query-functions’, it must return
nil when there are unsaved options and the user answered "yes".)
The reason that the behavior of
‘custom-prompt-customize-unsaved-options’ changed from version 27.2 to
28 almost certainly is the following:
‘custom-prompt-customize-unsaved-options’ calls ‘customize-unsaved’
which ends with call to ‘custom-buffer-create’. The definition of
‘custom-buffer-create’ changed from Emacs 27.2 to Emacs 28. In Emacs
27.2 it probably always returned non-nil. In Emacs 28 it always
returns nil.
However, the (and ...) form in
‘custom-prompt-customize-unsaved-options’ depends on
‘customize-unsaved’ to always return non-nil in order to be correct.
‘custom-prompt-customize-unsaved-options’ always had the bug reported
here. It just did not manifest before ‘custom-buffer-create’ was
changed from Emacs 27.2 to Emacs 28.
Best wishes,
Sebastian
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.