From 88459ee10649ff8db79fbb11210e9e273cd1f264 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sat, 16 Mar 2019 17:41:11 +0700 Subject: [PATCH] Fix #149: (setq doom-modeline-icon 1) fails and hangs emacs daemon. --- doom-modeline-segments.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index fd6df80..192a466 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -213,6 +213,17 @@ buffer where knowing the current project directory is important." (add-hook 'clone-indirect-buffer-hook #'doom-modeline-update-buffer-file-icon) (when (>= emacs-major-version 26) + (add-variable-watcher + 'doom-modeline-icon + (lambda (_sym val op _where) + (when (eq op 'set) + (setq doom-modeline-icon val) + ;; Fix #149: hang while changing `doom-modeline-icon' from nil to t + (if (and doom-modeline-icon + (not (featurep 'all-the-icons))) + (require 'all-the-icons)) + (doom-modeline-update-buffer-file-icon)))) + (add-variable-watcher 'all-the-icons-scale-factor (lambda (_sym val op _where)