I want to do some custom stuff before a window is deleted?
window-configuration-change-hook seems to be invoked after a window is deleted.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
GNU Emacs 188.8.131.52 (i686-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-04-25 shows that there is no such hook.
For an example the following advice would provide a hook for functions with a
WINDOW argument that is run before window
WINDOW is deleted.
(defvar window-before-delete-functions nil "Functions to be run with argument WINDOW before \(delete-window WINDOW).") (defun delete-window-ad (window) "Add `window-before-delete-functions' as before-advice of \(delete-window WINDOW)." (run-hook-with-args 'window-before-delete-functions (or window (selected-window)))) (advice-add #'delete-window :before #'delete-window-ad)
Just remove the hook functions in
window-before-delete-functions if something goes wrong with them.