2

I like having a proportional font in main buffer for writing plain text paragraphs (e.g. Georgia), but calendar buffer (M-x calendar) in org-mode looks funny (not properly aligned) if the font isn't monospaced (Cousine looks nice in calendar buffer, but not for paragraphs of text). Is there a way to configure Emacs (settings loaded from init.el) to display different fonts in main buffer and calendar buffer?

Also, tables look funny if the font isn't monospaced (not properly aligned, like in calendar buffer). Is it also possible to apply a font for tables that's different than the font of the main block of text?

  • I've found the reply here (original source here) – Claudiu Apr 22 '17 at 15:33
1

I've found the reply here (original source here).

Basically, having the following code in my init.el solved my problem and offered me exactly what I wanted:

  (defun set-buffer-variable-pitch ()
    (interactive)
    (variable-pitch-mode t)
    (setq line-spacing 3)
     (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
     (set-face-attribute 'org-code nil :inherit 'fixed-pitch)
     (set-face-attribute 'org-block nil :inherit 'fixed-pitch)
     (set-face-attribute 'org-block-background nil :inherit 'fixed-pitch)
    )

  (add-hook 'org-mode-hook 'set-buffer-variable-pitch)
  (add-hook 'eww-mode-hook 'set-buffer-variable-pitch)
  (add-hook 'markdown-mode-hook 'set-buffer-variable-pitch)
  (add-hook 'Info-mode-hook 'set-buffer-variable-pitch)

Before this to work though, I needed to have variable-pitch set in my configuration, with M-x customize-face on variable-pitch that resulted in the following line of code in my init.el:

 '(variable-pitch ((t (:height 200 :family "Georgia"))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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