diff --git a/core/core-popups.el b/core/core-popups.el index da2517bde..63387921d 100644 --- a/core/core-popups.el +++ b/core/core-popups.el @@ -59,7 +59,7 @@ is enabled/disabled.'") ;; `doom*delete-popup-window' ;; :autoclose If non-nil, close popup if ESC is pressed from any buffer. shackle-rules - '(("^ ?\\*doom:.+\\*$" :size 40 :modeline t :regexp t) + '(("^ ?\\*doom:.+\\*$" :size 25 :modeline minimal :regexp t :noesc t) ("^ ?\\*doom .+\\*$" :size 10 :noselect t :regexp t) ("^ *doom message*" :size 10 :noselect t :autokill t) ("*Metahelp*" :size 0.5 :autokill t :autoclose t) @@ -172,8 +172,9 @@ for :align t on every rule." (doom-hide-modeline-mode +1)) ((and (symbolp modeline) (not (eq modeline 't))) - (let ((doom--mode-line (doom-modeline modeline))) - (doom-hide-modeline-mode +1))))) + (let ((doom--modeline-format (doom-modeline modeline))) + (when doom--modeline-format + (doom-hide-modeline-mode +1)))))) ;; show modeline (when doom-hide-modeline-mode (doom-hide-modeline-mode -1)))) diff --git a/core/core-ui.el b/core/core-ui.el index 2c2b335b0..2eef00541 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -256,7 +256,7 @@ Example: (def-modeline! minimal (bar matches \" \" buffer-info) (media-info major-mode)) - (setq-default mode-line-format (doom-modeline 'minimal))" + (doom-set-modeline 'minimal t)" (let ((sym (intern (format "doom-modeline-format--%s" name))) (lhs-forms (doom--prepare-modeline-segments lhs)) (rhs-forms (doom--prepare-modeline-segments rhs))) @@ -278,9 +278,18 @@ Example: "Returns a mode-line configuration associated with KEY (a symbol). Throws an error if it doesn't exist." (let ((fn (intern (format "doom-modeline-format--%s" key)))) - (unless (functionp fn) - (error "Modeline format doesn't exist: %s" key)) - `(:eval (,fn)))) + (when (functionp fn) + `(:eval (,fn))))) + +(defun doom-set-modeline (key &optional default) + "Set the modeline format. Does nothing if the modeline KEY doesn't exist. If +DEFAULT is non-nil, set the default mode-line for all buffers." + (let ((modeline (doom-modeline key))) + (when modeline + (setf (if default + (default-value 'mode-line-format) + (buffer-local-value 'mode-line-format (current-buffer))) + modeline)))) (provide 'core-ui) ;;; core-ui.el ends here diff --git a/modules/app/twitter/config.el b/modules/app/twitter/config.el index 29184a889..a7de167ba 100644 --- a/modules/app/twitter/config.el +++ b/modules/app/twitter/config.el @@ -22,7 +22,7 @@ (add-hook 'twittering-mode-hook #'doom-buffer-mode)) (add-hook! twittering-mode - (setq header-line-format (doom-modeline 'twitter) + (setq header-line-format (or (doom-modeline 'twitter) mode-line-format) mode-line-format nil)) (map! :map twittering-mode-map diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index 39ebbec06..be00d38a4 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -101,9 +101,9 @@ whose dimensions may not be fully initialized by the time this is run." (unless +doom-dashboard-modeline (setq +doom-dashboard-old-modeline mode-line-format) (setq +doom-dashboard-modeline - (if (featurep! :ui doom-modeline) - (doom-modeline 'project) - mode-line-format))) + (or (and (featurep! :ui doom-modeline) + (doom-modeline 'project)) + mode-line-format))) (let ((old-pwd (or dir default-directory))) (with-current-buffer (doom-fallback-buffer) (+doom-dashboard-mode) diff --git a/modules/ui/doom-modeline/config.el b/modules/ui/doom-modeline/config.el index c61d61838..de31dfd77 100644 --- a/modules/ui/doom-modeline/config.el +++ b/modules/ui/doom-modeline/config.el @@ -20,7 +20,7 @@ "Display string STR in the mode-line next to minibuffer." (with-current-buffer (eldoc-current-buffer) (let* ((str (and (stringp input) input)) - (mode-line-format (or (and str (doom-modeline 'eldoc)) + (mode-line-format (or (and str (or (doom-modeline 'eldoc) str)) mode-line-format)) mode-line-in-non-selected-windows) (force-mode-line-update) @@ -562,12 +562,12 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions." (major-mode)) ;; -(setq-default mode-line-format (doom-modeline 'main)) +(doom-set-modeline 'main t) ;; This scratch buffer is already created, and doesn't get a modeline. For the ;; love of Emacs, someone give the man a modeline! (with-current-buffer "*scratch*" - (setq mode-line-format (doom-modeline 'main))) + (doom-set-modeline 'main)) ;; @@ -575,6 +575,6 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions." ;; (defun +doom-modeline|set-special-modeline () - (setq mode-line-format (doom-modeline 'special))) + (doom-set-modeline 'special)) (add-hook 'org-src-mode-hook #'+doom-modeline|set-special-modeline)