* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
@ 2022-03-10 16:19 Sebastian Miele
2022-03-10 17:09 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Miele @ 2022-03-10 16:19 UTC (permalink / raw)
To: 54329
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
`kill-emacs-query-functions'."
(not (and (custom-unsaved-options)
(yes-or-no-p "Some customized options have not been saved; Examine? ")
- (customize-unsaved)
- t)))
+ (prog1 t (customize-unsaved)))))
;;; Buffer.
Best wishes,
Sebastian Miele
In GNU Emacs 28.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.4)
of 2022-03-10 built on huette
Repository revision: d184773c2e2a69bea9b96190c83727b4e7a16542
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Arch Linux
Configured using:
'configure --with-x-toolkit=gtk3 --with-mailutils --with-cairo'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE
XIM XPM GTK3 ZLIB
Important settings:
value of $LC_CTYPE: de_DE.UTF-8
value of $LANG: C
locale-coding-system: utf-8-unix
Major mode: mu4e:main
Minor modes in effect:
vertico-mode: t
global-git-commit-mode: t
magit-auto-revert-mode: t
shell-dirtrack-mode: t
savehist-mode: t
recentf-mode: t
global-so-long-mode: t
global-eldoc-mode: t
show-paren-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
temp-buffer-resize-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
overwrite-mode: overwrite-mode-binary
Load-path shadows:
/home/w/usr/emacs/helpful/helpful hides /home/w/.config/emacs/usr/helpful-20220220.2308/helpful
/home/w/.config/emacs/usr/transient-20220307.2129/transient hides /home/w/usr/emacs/0/.0/lisp/transient
Features:
(shadow emacsbug macrostep-c cmacexp pulse xref dired-aux face-remap
bug-reference cus-edit cus-start calc-map calc-stat calc-vec calc-ext
calc-menu calc-aent calc calc-loaddefs rect calc-macs misearch
multi-isearch tabify cal-move consult-org vc-git vc-dispatcher saveplace
oc-basic disp-table ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-search eieio-opt speedbar ezimage dframe ol-docview
ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi whx-init::later mu4e
mu4e-org mu4e-main mu4e-view mu4e-view-gnus gnus-art mm-uu mml2015
mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start
gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win mu4e-view-common mu4e-headers
mu4e-compose mu4e-context mu4e-draft mu4e-actions ido rfc2368 smtpmail
sendmail mu4e-mark mu4e-proc mu4e-utils doc-view jka-compr image-mode
exif mu4e-lists mu4e-message flow-fill mule-util hl-line mu4e-vars
mu4e-meta apache-mode systemd pkgbuild-mode flymake-proc flymake project
warnings cmake-font-lock cmake-mode rst gitignore-mode gitconfig-mode
conf-mode gitattributes-mode sh-script executable lua-mode json-mode
json-snatcher js cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs yaml-mode vcard css-mode smie
sgml-mode facemenu eww url-queue shr kinsoku svg xml dom mm-url gnus
nnheader markdown-mode color thingatpt tex-mode compile ob-shell
org-bullets ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util
rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex
ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox ace-window
avy consult-vertico consult magit-bookmark bookmark orderless vertico
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff diff-mode git-commit log-edit message rmc puny rfc822
mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor magit-mode magit-git magit-base magit-section
crm diary-lib diary-loaddefs cal-iso helpful imenu trace edebug
info-look f elisp-refs man dired dired-loaddefs descr-text tramp-sh
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
shell parse-time iso8601 ls-lisp server whx::safe-local whx-etc::0
whx::transient whx::arg whx::plist whx::list transient cl-extra
whx::elpa whx-boot-lib::elpa whx-etc::org whx-etc::org-link
whx-etc::org-password whx::password whx::pcase whx::walk org-element
org-persist xdg org-id org-refile avl-tree generator whx-etc::org-hide
cus-load org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color
org-list org-faces org-entities org-version ob-emacs-lisp ob-core
ob-eval org-table ol org-keys oc org-compat advice org-macs org-loaddefs
format-spec cal-menu calendar cal-loaddefs whx-etc::elisp whx::elisp
whx::string s whx::feature dash debug backtrace find-func macrostep pp
whx-etc::gc edmacro kmacro whx::binary-unit-prefix whx::bind whx::log
whx::meta whx::cl whx::error whx-etc::session savehist recentf
tree-widget wid-edit whx-etc::custom whx-etc::core-settings so-long
noutline outline easy-mmode diminish no-littering
whx-etc::modus-operandi whx-etc::modus-operandi-theme
modus-operandi-theme whx::custom modus-themes time-date finder-inf
geiser-impl help-fns radix-tree help-mode geiser-custom geiser-base ring
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source eieio eieio-core eieio-loaddefs password-cache
json map url-vars seq byte-opt bytecomp byte-compile cconv
whx-init::early whx-boot whx-boot::run-level whx-boot-etc::run-level
cl-seq whx-boot-etc::packages whx-boot-etc::directories
whx-boot::after-init-hook whx-boot-etc::core-settings
whx-boot-lib::custom whx-boot-lib::fs-path subr-x whx-boot-lib::symbol
whx-boot::session-type whx-boot::verbosity whx-boot-lib::log
whx-boot::early-cmdline whx-boot-lib::string rx whx-boot-lib::feature
whx-boot-lib::0 info whx-boot-lib::list whx-boot-lib::meta
whx-boot-lib::pcase pcase whx-boot-lib::error cl-macs gv cl-loaddefs
cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 796178 377838)
(symbols 48 59796 95)
(strings 32 239722 35837)
(string-bytes 1 7038659)
(vectors 16 93521)
(vector-slots 8 2209654 370338)
(floats 8 569 1111)
(intervals 56 13204 6070)
(buffers 992 26))
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
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
2022-03-10 17:17 ` Sebastian Miele
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2022-03-10 17:09 UTC (permalink / raw)
To: Sebastian Miele; +Cc: 54329
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
2022-03-10 17:09 ` Eli Zaretskii
@ 2022-03-10 17:17 ` Sebastian Miele
2022-03-10 18:29 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Miele @ 2022-03-10 17:17 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 54329
Hi Eli,
Eli Zaretskii <eliz@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
2022-03-10 17:17 ` Sebastian Miele
@ 2022-03-10 18:29 ` Eli Zaretskii
2022-03-10 18:55 ` Sebastian Miele
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2022-03-10 18:29 UTC (permalink / raw)
To: Sebastian Miele; +Cc: 54329
> From: Sebastian Miele <iota@whxvd.name>
> Cc: 54329@debbugs.gnu.org
> Date: Thu, 10 Mar 2022 18:17:02 +0100
>
> 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.
Thanks, this was the information I missed.
I installed a minor variation of your changes on the emacs-28 branch.
Please take a look.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
2022-03-10 18:29 ` Eli Zaretskii
@ 2022-03-10 18:55 ` Sebastian Miele
2022-03-10 19:55 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Miele @ 2022-03-10 18:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 54329
Eli Zaretskii <eliz@gnu.org>:
> I installed a minor variation of your changes on the emacs-28 branch.
> Please take a look.
Thank you. Looks good and seems to work.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#54329: 28.0.91; custom-prompt-customize-unsaved-options does not return nil
2022-03-10 18:55 ` Sebastian Miele
@ 2022-03-10 19:55 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-03-10 19:55 UTC (permalink / raw)
To: Sebastian Miele; +Cc: 54329-done
> From: Sebastian Miele <iota@whxvd.name>
> Cc: 54329@debbugs.gnu.org
> Date: Thu, 10 Mar 2022 19:55:55 +0100
>
> Eli Zaretskii <eliz@gnu.org>:
> > I installed a minor variation of your changes on the emacs-28 branch.
> > Please take a look.
>
> Thank you. Looks good and seems to work.
Great, I'm therefore closing this bug.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-03-10 19:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.