Skip to content

Commit

Permalink
transient-maybe-save-history: Demote error
Browse files Browse the repository at this point in the history
Since this function is added to `kill-emacs-hook', an error here makes
it impossible to close Emacs.  In normal use errors are very unlikely,
but due to a backward incompatible change in `generate-new-buffer' it
does happen when I quickly use an older Emacs without recompiling this
library.
  • Loading branch information
tarsius committed Feb 26, 2025
1 parent f486f03 commit e3644fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ should not change it manually.")
"Save the value of `transient-history'.
If `transient-save-history' is nil, then do nothing."
(when transient-save-history
(transient-save-history)))
(with-demoted-errors "Error saving transient history: %S"
(transient-save-history))))

(unless noninteractive
(add-hook 'kill-emacs-hook #'transient-maybe-save-history))
Expand Down

0 comments on commit e3644fa

Please sign in to comment.