Fix #149: (setq doom-modeline-icon 1) fails and hangs emacs daemon.

This commit is contained in:
Vincent Zhang 2019-03-16 17:41:11 +07:00
parent 04ed6ec68f
commit 88459ee106

View file

@ -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) (add-hook 'clone-indirect-buffer-hook #'doom-modeline-update-buffer-file-icon)
(when (>= emacs-major-version 26) (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 (add-variable-watcher
'all-the-icons-scale-factor 'all-the-icons-scale-factor
(lambda (_sym val op _where) (lambda (_sym val op _where)