From b3b31e4bd452942ce5238c2f9c29a7d858f2836b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 4 Jan 2018 16:55:00 -0500 Subject: [PATCH] Display *Warnings* buffer in main workspace after startup #319 The creation of the main workspace would swallow the Warnings buffer, so we forcibly display it (if it exists) on startup. --- core/core.el | 7 ------- modules/feature/workspaces/config.el | 6 +++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/core/core.el b/core/core.el index b087e12f6..fbcc2348d 100644 --- a/core/core.el +++ b/core/core.el @@ -146,10 +146,6 @@ ability to invoke the debugger in debug mode." ;;; ;; Initialize (eval-and-compile - ;; Defer warnings during the Doom startup process, giving other modules more - ;; time to initialize and make mistakes. - (remove-hook 'delayed-warnings-hook #'display-delayed-warnings) - (defvar doom--file-name-handler-alist file-name-handler-alist) (unless (or after-init-time noninteractive) ;; One of the contributors to long startup times is the garbage collector, @@ -188,9 +184,6 @@ ability to invoke the debugger in debug mode." (dolist (hook '(doom-init-hook doom-post-init-hook)) (run-hook-wrapped hook #'doom-try-run-hook hook))) - ;; We're ready to display warnings now. - (add-hook 'delayed-warnings-hook #'display-delayed-warnings t) - ;; If you forget to reset this, you'll get stuttering and random freezes! (setq gc-cons-threshold 16777216 gc-cons-percentage 0.1 diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index c66148228..5cd106696 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -71,7 +71,11 @@ renamed.") ;; Switch to it if we aren't auto-loading the last session (when (and (equal (safe-persp-name (get-current-persp)) persp-nil-name) (= persp-auto-resume-time -1)) - (persp-frame-switch +workspaces-main (or frame (selected-frame)))))) + (persp-frame-switch +workspaces-main (or frame (selected-frame)))) + ;; Make sure warnings are visible (fix #319) + (when-let* ((warnings (get-buffer "*Warnings*"))) + (display-buffer-in-side-window + warnings '((window-height . shrink-window-if-larger-than-buffer)))))) (defun +workspaces|init-persp-mode () ;; Remap `buffer-list' to current workspace's buffers in `doom-buffer-list'