From: Lars Ingebrigtsen Date: Fri, 2 Jul 2021 15:33:37 +0000 (+0200) Subject: Adjust eshell and ps-print to not use emacs-kill-hook X-Git-Tag: emacs-28.0.90~1961 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46d4ddd1767284e8a42b01e7880c2658c5957ab1;p=emacs.git Adjust eshell and ps-print to not use emacs-kill-hook * lisp/ps-print.el (ps-kill-emacs-check): * lisp/eshell/em-dirs.el (eshell-dirs-initialize) (eshell-save-some-last-dir): Don't use `emacs-kill-hook' (bug#28943). * lisp/eshell/em-hist.el (eshell-hist-initialize) (eshell-save-some-history): --- diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index c04a1a67d58..ee9057f50e8 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -224,7 +224,7 @@ Thus, this does not include the current directory.") (add-hook 'eshell-exit-hook #'eshell-write-last-dir-ring nil t) - (add-hook 'kill-emacs-hook #'eshell-save-some-last-dir)) + (add-hook 'kill-emacs-query-functions #'eshell-save-some-last-dir)) (defun eshell-save-some-last-dir () "Save the list-dir-ring for any open Eshell buffers." @@ -238,7 +238,8 @@ Thus, this does not include the current directory.") (format-message "Save last dir ring for Eshell buffer `%s'? " (buffer-name buf))))) - (eshell-write-last-dir-ring)))))) + (eshell-write-last-dir-ring))))) + t) (defun eshell-lone-directory-p (file) "Test whether FILE is just a directory name, and not a command name." diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 18e19a9d9a5..d82946add00 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -293,7 +293,7 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (add-hook 'eshell-exit-hook #'eshell-write-history nil t) - (add-hook 'kill-emacs-hook #'eshell-save-some-history) + (add-hook 'kill-emacs-query-functions #'eshell-save-some-history) (add-hook 'eshell-input-filter-functions #'eshell-add-to-history nil t)) @@ -310,7 +310,8 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (format-message "Save input history for Eshell buffer `%s'? " (buffer-name buf))))) - (eshell-write-history)))))) + (eshell-write-history))))) + t) (defun eshell/history (&rest args) "List in help buffer the buffer's input history." diff --git a/lisp/ps-print.el b/lisp/ps-print.el index fcc6e1fd834..1b8654ead2b 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -6506,10 +6506,11 @@ If FACE is not a valid face name, use default face." (and (buffer-live-p ps-buffer) (buffer-modified-p ps-buffer) (not (yes-or-no-p "Unprinted PostScript waiting; exit anyway? ")) - (error "Unprinted PostScript")))) + (error "Unprinted PostScript"))) + t) (unless noninteractive - (add-hook 'kill-emacs-hook #'ps-kill-emacs-check)) + (add-hook 'kill-emacs-query-functions #'ps-kill-emacs-check)) (provide 'ps-print)