Admittedly, this is something of a first world problem, but I'm sort of picky about the appearance of the display, and I find it really annoying when some mode sets a new font size, family, bold/italic, etc. What I'd like to do is put (set-frame-font "Menlo-10")
near the top of my .emacs, and then force emacs to never change any aspect from that default font except for color.
I can sort of get the effect I want by doing something like this:
(mapc (lambda (face)
(set-face-attribute face nil
:family "Menlo"
;; something like (cdr (assoc 'font (frame-parameters)) would be better
;; for the :family, but it didn't immediately work
:width 'normal
:height 1.0
:weight 'normal
:underline nil
:slant 'normal))
(remove 'default (face-list)))
but that only works after I've loaded a new buffer that has created font-lock faces to be changed, and it's a dreadful hack regardless. I suspect there just isn't really in facility in font-locking for ignoring some parts of what a mode requests, but I thought I'd ask.
Also, AUCTeX is by far the worst offender here, so if there's alternately just an AUCTeX setting somewhere to prevent it from requesting changes in family, size, etc. in the first place, that would at least make the problem less annoying.
I'm currently using a recent Emacs 24 pulled from HEAD.
Running
customize-face
with your cursor on the face you are interested in will allow you to see how that face is defined (and change it). Doing this on the section title gives mefont-latex-sectioning-1-face
. This inherits fromfont-latex-sectioning-2-face
etc. down tofont-latex-sectioning-5-face
which in turn inherits formvariable-pitch
(which is what changes the font family). The documentation also mentions that it's best to change the base facefont-latex-sectioning-5-face
, or the variablefont-latex-fontify-sectioning
. You can set this last to'color
which will do what you want (I think). Alternately, you can customizefont-latex-sectioning-5-face
to not inherit fromvariable-pitch
, or changevariable-pitch
to not be variable pitch.