merge whitespace-style with global value, not local

And ensure it runs as late as possible in after-change-major-mode-hook.

Hopefully to increase the probability of
doom-highlight-non-default-indentation-h detecting a user-enabled
whitespace-mode and bowing out in time.
This commit is contained in:
Henrik Lissner 2019-07-26 13:57:42 +02:00
parent 9311744f7f
commit 88096a81a9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -141,7 +141,7 @@ read-only or not file-visiting."
(set (make-local-variable 'whitespace-style)
(let ((style (if indent-tabs-mode '(indentation) '(tabs tab-mark))))
(if whitespace-mode
(cl-union style whitespace-style)
(cl-union style (default-value 'whitespace-style))
`(face ,@style))))
(add-to-list 'whitespace-style 'face)
(whitespace-mode +1)))
@ -649,7 +649,7 @@ startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil."
(run-hook-wrapped 'doom-init-ui-hook #'doom-try-run-hook)
(add-to-list 'kill-buffer-query-functions #'doom-protect-fallback-buffer-h nil 'eq)
(add-hook 'after-change-major-mode-hook #'doom-highlight-non-default-indentation-h)
(add-hook 'after-change-major-mode-hook #'doom-highlight-non-default-indentation-h 'append)
;; Initialize custom switch-{buffer,window,frame} hooks:
;; + `doom-switch-buffer-hook'