diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-16 07:58:26 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-16 07:58:26 -0500 |
| commit | 56d105f0ec3b7e5e4088d0683ae9cc5797442854 (patch) | |
| tree | 6798c110e2fdde6797e4a8a12c7dacaae689313c /modules/system-lib.el | |
| parent | cbc79f9d49de860134e12fc348560c7e43aea8f2 (diff) | |
| download | dotemacs-56d105f0ec3b7e5e4088d0683ae9cc5797442854.tar.gz dotemacs-56d105f0ec3b7e5e4088d0683ae9cc5797442854.zip | |
fix(mail): theme mu4e buffers via a shared font-lock exclusion
mu4e paints its header lines, main menu, and view headers with manual `face' text properties. Global font-lock stripped them, so the buffers rendered unthemed, the same failure the dashboard hit. I extracted the dashboard's one-off exclusion into a shared, additive cj/exclude-from-global-font-lock helper in system-lib and repointed the dashboard to it. Then I excluded mu4e-headers-mode, mu4e-main-mode, and mu4e-view-mode. The view body renders through gnus's own washing rather than font-lock, so excluding it is safe.
Diffstat (limited to 'modules/system-lib.el')
| -rw-r--r-- | modules/system-lib.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/system-lib.el b/modules/system-lib.el index 9e25be5b7..ed98a476e 100644 --- a/modules/system-lib.el +++ b/modules/system-lib.el @@ -141,5 +141,28 @@ long-form answer, keeping a stray RET or space from confirming." (let ((use-short-answers nil)) (yes-or-no-p prompt))) +(defun cj/--font-lock-global-modes-excluding (current mode) + "Return CURRENT `font-lock-global-modes' with MODE added to the exclusion. +CURRENT has one of three shapes: t (font-lock on in all modes), a +\(not M...) exclusion list, or an (M...) inclusion list. Pure: returns +the new value and mutates nothing." + (cond + ((eq current t) (list 'not mode)) + ((and (consp current) (eq (car current) 'not)) + (if (memq mode (cdr current)) current + (cons 'not (cons mode (cdr current))))) + ((consp current) (delq mode (copy-sequence current))) + (t current))) + +(defun cj/exclude-from-global-font-lock (&rest modes) + "Exclude MODES from `global-font-lock-mode'. +Some major modes (dashboard, mu4e) paint their buffers with manual `face' +text properties; global font-lock then strips those, leaving the buffer +unthemed. Excluding the mode keeps its faces. Additive, so each caller +contributes its own modes regardless of load order." + (dolist (mode modes) + (setq font-lock-global-modes + (cj/--font-lock-global-modes-excluding font-lock-global-modes mode)))) + (provide 'system-lib) ;;; system-lib.el ends here |
