perf: defer init for frame's buffer-predicate

Ensures that it doesn't pull in the buffer library so early in the
startup process, or gets called prematurely.
This commit is contained in:
Henrik Lissner 2022-09-20 01:50:09 +02:00
parent 7a81b0252f
commit c5de95f722
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -187,9 +187,6 @@ or if the current buffer is read-only or not file-visiting."
;;
;;; Buffers
;; Make `next-buffer', `other-buffer', etc. ignore unreal buffers.
(push '(buffer-predicate . doom-buffer-frame-predicate) default-frame-alist)
(defadvice! doom--switch-to-fallback-buffer-maybe-a (&rest _)
"Switch to `doom-fallback-buffer' if on last real buffer.
@ -596,6 +593,9 @@ triggering hooks during startup."
(add-hook 'kill-buffer-query-functions #'doom-protect-fallback-buffer-h)
(add-hook 'after-change-major-mode-hook #'doom-highlight-non-default-indentation-h 'append)
;; Make `next-buffer', `other-buffer', etc. ignore unreal buffers.
(push '(buffer-predicate . doom-buffer-frame-predicate) default-frame-alist)
;; Initialize `doom-switch-window-hook' and `doom-switch-frame-hook'
(add-hook 'window-selection-change-functions #'doom-run-switch-window-or-frame-hooks-h)
;; Initialize `doom-switch-buffer-hook'