Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook + Replace doom-{enter,exit}-{buffer,window}-hook with doom-switch-{buffer,window}-hook + New switch-buffer hooks run on buffer-list-update-hook rather than in select-window advice. + Blank our buffer-list-update-hook in some places to reduce how many times it gets triggered.
This commit is contained in:
parent
8f2fb07948
commit
a05b1877be
9 changed files with 93 additions and 104 deletions
|
@ -44,14 +44,14 @@ warning)."
|
|||
(make-directory +wakatime-home t)))
|
||||
(global-wakatime-mode +1))
|
||||
;;
|
||||
(remove-hook 'doom-exit-buffer-hook #'+wakatime|autostart)
|
||||
(remove-hook 'doom-switch-buffer-hook #'+wakatime|autostart)
|
||||
(advice-remove 'after-find-file #'+wakatime|autostart))
|
||||
|
||||
;;;###autoload
|
||||
(defun +wakatime|delayed-autostart (&rest _)
|
||||
"Lazily initialize `wakatime-mode' until the next time you switch buffers or
|
||||
open a file."
|
||||
(add-hook 'doom-exit-buffer-hook #'+wakatime|autostart)
|
||||
(add-hook 'doom-switch-buffer-hook #'+wakatime|autostart)
|
||||
;; this is necessary in case the user opens emacs with file arguments
|
||||
(advice-add 'after-find-file :before #'+wakatime|autostart))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue