emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 46d4ddd 1/2: Adjust eshell and ps-print to not use emacs-kill-hoo


From: Lars Ingebrigtsen
Subject: master 46d4ddd 1/2: Adjust eshell and ps-print to not use emacs-kill-hook
Date: Sun, 4 Jul 2021 09:32:16 -0400 (EDT)

branch: master
commit 46d4ddd1767284e8a42b01e7880c2658c5957ab1
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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):
---
 lisp/eshell/em-dirs.el | 5 +++--
 lisp/eshell/em-hist.el | 5 +++--
 lisp/ps-print.el       | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index c04a1a6..ee9057f 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 18e19a9..d82946a 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 fcc6e1f..1b8654e 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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]