Add new doom|mark-buffer-as-real hook to term/eshell
This is simpler (and perhaps faster) than doom-real-buffer-functions. Better to reserve that for more complex logic.
This commit is contained in:
parent
ee154a3eb7
commit
3027ed2f7f
3 changed files with 12 additions and 6 deletions
|
@ -174,6 +174,16 @@ regex PATTERN. Returns the number of killed buffers."
|
||||||
(kill-buffer buf))))
|
(kill-buffer buf))))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Hooks
|
||||||
|
;;
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom|mark-buffer-as-real ()
|
||||||
|
"Hook function that marks the current buffer as real."
|
||||||
|
(doom-set-buffer-real (current-buffer) t))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Interactive commands
|
;; Interactive commands
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -29,9 +29,7 @@
|
||||||
|
|
||||||
:config
|
:config
|
||||||
;; Consider eshell buffers real
|
;; Consider eshell buffers real
|
||||||
(defun +eshell-p (buf)
|
(add-hook 'eshell-mode-hook #'doom|mark-buffer-as-real)
|
||||||
(eq (buffer-local-value 'major-mode buf) 'eshell-mode))
|
|
||||||
(add-to-list 'doom-real-buffer-functions #'+eshell-p nil #'eq)
|
|
||||||
|
|
||||||
;; Keep track of open eshell buffers
|
;; Keep track of open eshell buffers
|
||||||
(add-hook 'eshell-mode-hook #'+eshell|init)
|
(add-hook 'eshell-mode-hook #'+eshell|init)
|
||||||
|
|
|
@ -9,6 +9,4 @@
|
||||||
(set! :env "SHELL")
|
(set! :env "SHELL")
|
||||||
|
|
||||||
;; Consider term buffers real
|
;; Consider term buffers real
|
||||||
(defun +term-p (buf)
|
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real))
|
||||||
(eq (buffer-local-value 'major-mode buf) 'term-mode))
|
|
||||||
(add-to-list 'doom-real-buffer-functions #'+term-p nil #'eq))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue