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):
This commit is contained in:
Lars Ingebrigtsen 2021-07-02 17:33:37 +02:00
parent 3dae1e42e1
commit 46d4ddd176
3 changed files with 9 additions and 6 deletions

View 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."

View 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."

View 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)