Add narf.window-switch-hook
This commit is contained in:
parent
8598eb87cd
commit
946a2b3c2c
|
@ -58,6 +58,19 @@ enable multiple minor modes for the same regexp.")
|
|||
(add-hook! find-file 'narf|enable-minor-mode-maybe)
|
||||
|
||||
|
||||
;; Hook for window switching ;;;;;;;
|
||||
|
||||
(defvar narf.window-switch-hook '()
|
||||
"Hooks run before switching windows. Hooks take two arguments (one is
|
||||
optional): WINDOW and NORECORD. WINDOW is the window being switched to. Use
|
||||
`current-buffer' to get the buffer being switched from. See `select-window' for
|
||||
details on NORECORD.")
|
||||
|
||||
(defun narf*run-window-switch-hooks (window &optional norecord)
|
||||
(run-hook-with-args 'narf.window-switch-hook window norecord))
|
||||
(advice-add 'select-window :before 'narf*run-window-switch-hooks)
|
||||
|
||||
|
||||
;; Modes 'n hooks ;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(associate! sh-mode :match "/\\.?z\\(profile\\|login\\|logout\\|shrc\\|shenv\\)?$")
|
||||
|
|
Loading…
Reference in New Issue
Block a user