Fix #4991: writeroom-mode + mixed-pitch not remapping fonts

mixed-pitch-mode was toggled *before* text-scale-mode was.  They both
preform face remapping, but use the same strategy to accomplish it, so
the less complex mode should go first. In this case, that's text-scale.
This commit is contained in:
Henrik Lissner 2021-05-07 02:27:51 -04:00
parent 9561089ff5
commit 075e66f4d7

View file

@ -23,12 +23,14 @@
(setq writeroom-global-effects nil) (setq writeroom-global-effects nil)
(setq writeroom-maximize-window nil) (setq writeroom-maximize-window nil)
(add-hook! 'writeroom-mode-hook (add-hook! 'writeroom-mode-hook :append
(defun +zen-enable-text-scaling-mode-h () (defun +zen-enable-text-scaling-mode-h ()
"Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'." "Enable `mixed-pitch-mode' when in `+zen-mixed-pitch-modes'."
(when (/= +zen-text-scale 0) (when (/= +zen-text-scale 0)
(text-scale-set (if writeroom-mode +zen-text-scale 0)) (text-scale-set (if writeroom-mode +zen-text-scale 0))
(visual-fill-column-adjust))) (visual-fill-column-adjust))))
(add-hook! 'global-writeroom-mode-hook
(defun +zen-toggle-large-window-dividers-h () (defun +zen-toggle-large-window-dividers-h ()
"Make window dividers larger and easier to see." "Make window dividers larger and easier to see."
(when (bound-and-true-p window-divider-mode) (when (bound-and-true-p window-divider-mode)