diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-08-21 13:18:47 -0700 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-08-21 13:18:47 -0700 |
commit | 2e8bbd5881d8851f19c8eb0b60def932d69b4dbc (patch) | |
tree | 2b6bf0d376d5810715a22d2cb256f3da5add9611 /lisp/window.el | |
parent | 6224fce0d4168fb217175a2c9e40409a0055e436 (diff) | |
download | emacs-2e8bbd5881d8851f19c8eb0b60def932d69b4dbc.tar.gz emacs-2e8bbd5881d8851f19c8eb0b60def932d69b4dbc.tar.bz2 emacs-2e8bbd5881d8851f19c8eb0b60def932d69b4dbc.zip |
Call `quit-window-hook' in the `quit-window' command only
* lisp/window.el (quit-restore-window): Don't run quit-window-hook
here...
(quit-window): ... but here instead. Callers that call the former
programmatically can decide themselves whether to call the hook.
(quit-window-hook): Fix doc string.
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/window.el b/lisp/window.el index 80dbd64f18a..334b56c8e60 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4849,7 +4849,7 @@ all window-local buffer lists." (unrecord-window-buffer window buffer))))) (defcustom quit-window-hook nil - "Hook run before performing any other actions in the `quit-buffer' command." + "Hook run before performing any other actions in the `quit-window' command." :type 'hook :version "27.1" :group 'windows) @@ -4882,11 +4882,7 @@ nil means to not handle the buffer in a particular way. This most reliable remedy to not have `switch-to-prev-buffer' switch to this buffer again without killing the buffer. -`kill' means to kill WINDOW's buffer. - -The functions in `quit-window-hook' will be run before doing -anything else." - (run-hooks 'quit-window-hook) +`kill' means to kill WINDOW's buffer." (setq window (window-normalize-window window t)) (let* ((buffer (window-buffer window)) (quit-restore (window-parameter window 'quit-restore)) @@ -4986,6 +4982,7 @@ one. If non-nil, reset `quit-restore' parameter to nil. The functions in `quit-window-hook' will be run before doing anything else." (interactive "P") + (run-hooks 'quit-window-hook) (quit-restore-window window (if kill 'kill 'bury))) (defun quit-windows-on (&optional buffer-or-name kill frame) |