Use `setq-local' instead of `setq'; `let' binding fails

This commit is contained in:
Gerard Vermeulen 2024-03-14 11:25:49 +01:00
parent b739c13005
commit e488cb26d4
1 changed files with 4 additions and 4 deletions

View File

@ -622,15 +622,15 @@ verse and quote blocks are fontified using the `org-verse' and
(defun set-buffer-variable-pitch-face ()
"Set a variable width (proportional) font in current buffer."
(interactive)
(let ((buffer-face-mode-face 'variable-pitch))
(buffer-face-mode)))
(setq-local buffer-face-mode-face 'variable-pitch)
(buffer-face-mode))
;; Use monospaced font faces in current buffer
(defun set-buffer-fixed-pitch-face ()
"Set a fixed width (monospace) font in current buffer."
(interactive)
(let ((buffer-face-mode-face 'fixed-pitch))
(buffer-face-mode)))
(setq-local buffer-face-mode-face 'fixed-pitch)
(buffer-face-mode))
(add-hook 'magit-mode-hook #'set-buffer-fixed-pitch-face)
(add-hook 'prog-mode-hook #'set-buffer-fixed-pitch-face)