I found out about variable-pitch-mode
through a thread here on StackOverflow, and it\'s very handy when writing in org-mode
, easier on the eyes and
This code will make tables and ascii art and source code blocks to be displayed in monospace font, while preserving other font attributes for tables (such as color blue) and so on. Code is based on the other answer, the only difference is preservation.
(defun my-adjoin-to-list-or-symbol (element list-or-symbol)
(let ((list (if (not (listp list-or-symbol))
(list list-or-symbol)
list-or-symbol)))
(require 'cl-lib)
(cl-adjoin element list)))
(eval-after-load "org"
'(mapc
(lambda (face)
(set-face-attribute
face nil
:inherit
(my-adjoin-to-list-or-symbol
'fixed-pitch
(face-attribute face :inherit))))
(list 'org-code 'org-block 'org-table 'org-block-background)))
If you'd like to learn how this works and how to apply this to other situations (such as Info mode), read my post on the subject
See if this works,
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
You may use C-u C-x = to see which face is in effect at a particular point.