1

I tried set-frame-font but it changes the font for not just the buffer, but also minibuffer and modeline.

Is it possible to just change the font for the buffer, but not minibuffer and modeline?

i.e. I want to change the font of the text I'm editing, but not the font of emacs' own interface.

1 Answer 1

1

To get this

enter image description here

do this

(require 'subr-x)
(require 'seq)

(require 'face-remap)

(defface default-text
  '((t :family "Comic Sans MS"))
  "Face for regular text."
  :group 'basic-faces)

(custom-set-variables
 '(buffer-face-mode-face 'default-text-face))

(custom-set-faces
 '(default-text-face  ((t (:family "Comic Sans MS"))) t)
 '(org-default ((t (:inherit default-text)))))

(defun buffer-face-mode--turn-on ()
  (when (and (not (minibufferp))
             (thread-last '(text-mode)
                          (seq-some
                           (lambda (it)
                             (derived-mode-p it)))))
    (buffer-face-mode 1)))

(define-globalized-minor-mode global-buffer-face-mode
  buffer-face-mode buffer-face-mode--turn-on)

(global-buffer-face-mode 1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.