]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust eshell and ps-print to not use emacs-kill-hook
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 2 Jul 2021 15:33:37 +0000 (17:33 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 4 Jul 2021 12:07:59 +0000 (14:07 +0200)
* 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):

lisp/eshell/em-dirs.el
lisp/eshell/em-hist.el
lisp/ps-print.el

index c04a1a67d58f4b676d4e32c8dbfa1e78b63321c1..ee9057f50e8b8c4b273c7c0ff6e1861204cb22e3 100644 (file)
@@ -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."
index 18e19a9d9a508c987f432a4326d865d11e5bf925..d82946add0052ce389f563dea8b559ba42549f16 100644 (file)
@@ -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."
index fcc6e1fd834397bbe62f3ffb58a1c764e6d307e6..1b8654ead2b5c88357f0fcbf374be0caa59cacfb 100644 (file)
@@ -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)