feature/workspace: don't pop up warnings/display tabs on every new frame
This commit is contained in:
parent
81bba9c0bc
commit
dc2b905933
1 changed files with 15 additions and 10 deletions
|
@ -31,6 +31,10 @@ renamed.")
|
||||||
(+workspaces|init-frame (selected-frame))))
|
(+workspaces|init-frame (selected-frame))))
|
||||||
|
|
||||||
(defun +workspaces|init-frame (frame)
|
(defun +workspaces|init-frame (frame)
|
||||||
|
"Make sure a main workspace exists and is switched to, if FRAME isn't in any
|
||||||
|
workspace. Also ensures that the *Warnings* buffer will be visible in main.
|
||||||
|
|
||||||
|
Uses `+workspaces-main' to determine the name of the main workspace."
|
||||||
(unless persp-mode
|
(unless persp-mode
|
||||||
(persp-mode +1))
|
(persp-mode +1))
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
|
@ -45,16 +49,17 @@ renamed.")
|
||||||
;; Switch to it if we aren't auto-loading the last session
|
;; Switch to it if we aren't auto-loading the last session
|
||||||
(when (and (string= (safe-persp-name (get-current-persp)) persp-nil-name)
|
(when (and (string= (safe-persp-name (get-current-persp)) persp-nil-name)
|
||||||
(= persp-auto-resume-time -1))
|
(= persp-auto-resume-time -1))
|
||||||
(persp-frame-switch +workspaces-main frame))
|
(persp-frame-switch +workspaces-main frame)
|
||||||
;; We want to know where we are in every new daemon frame
|
;; We want to know where we are in every new daemon frame
|
||||||
(when (daemonp)
|
(when (daemonp)
|
||||||
(run-at-time 0.2 nil #'+workspace/display))
|
(run-at-time 0.1 nil #'+workspace/display))
|
||||||
;; The warnings buffer gets swallowed by creating `+workspaces-main', so
|
;; The warnings buffer gets swallowed by creating
|
||||||
;; we display it manually, if it exists (fix #319).
|
;; `+workspaces-main', so we display it manually, if it exists (fix
|
||||||
(when-let* ((warnings (get-buffer "*Warnings*")))
|
;; #319).
|
||||||
(save-excursion
|
(when-let* ((warnings (get-buffer "*Warnings*")))
|
||||||
(display-buffer-in-side-window
|
(save-excursion
|
||||||
warnings '((window-height . shrink-window-if-larger-than-buffer)))))))))
|
(display-buffer-in-side-window
|
||||||
|
warnings '((window-height . shrink-window-if-larger-than-buffer))))))))))
|
||||||
|
|
||||||
(add-hook 'doom-init-hook #'+workspaces|init)
|
(add-hook 'doom-init-hook #'+workspaces|init)
|
||||||
:config
|
:config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue