Load window-purpose when window configuration changes

This commit is contained in:
syl20bnr 2018-06-14 02:07:02 -04:00
parent ea0f73ec31
commit d19a20beb4
2 changed files with 7 additions and 5 deletions

View File

@ -47,8 +47,8 @@ If FUNC is a lambda you must give it a name with FNAME. "
result)
(setq result
(append (when fname
`((fset ',fname (lambda () (funcall #',func)))))
`((fset ',hfunc (lambda ()
`((fset ',fname (lambda (&rest _) (funcall #',func)))))
`((fset ',hfunc (lambda (&rest _)
,(if fname (list fname) (list func))
,(if (functionp hook)
`(advice-remove ',hook ',hfunc)

View File

@ -108,9 +108,11 @@
:defer (spacemacs/defer 1)
:init
(progn
(spacemacs|add-transient-hook pre-command-hook
(lambda () (require 'window-purpose))
lazy-load-window-purpose)
(add-hook 'emacs-startup-hook
(lambda ()
(spacemacs|add-transient-hook window-configuration-change-hook
(lambda () (require 'window-purpose))
lazy-load-window-purpose)))
;; 'r' is for "puRpose" ('w', 'p' are crowded, 'W', 'P' aren't
;; comfortable)
(spacemacs/set-leader-keys