How do I set the font size of comments in emacs. I want the comments to be smaller in size than the rest of the code. I also want it to be highlighted.
Asked
Active
Viewed 238 times
1 Answers
1
Run M-x customize-face font-lock-comment-face and set the height
attribute, along with background
and foreground
to how you want the comments to be highlighted.
To persist this between sessions, choose Save for future sessions
from the customization screen or add this to your .emacs
:
(custom-set-faces
'(font-lock-comment-face ((t (:background "yellow" :foreground "red" :height 0.5)))))

ataylor
- 64,891
- 24
- 161
- 189
-
could you please give the code for it? I want to do it in the .emacs file. – sudeepdino008 Oct 31 '12 at 19:25
-
You can save it to your `.emacs` by saving the customization for future sessions. Added this code the answer. – ataylor Oct 31 '12 at 19:35
-
1Just beware: you do not want to have more than one call to `custom-set-faces` in your `.emacs`. I.e. if you want to change several faces, do it within the same `custom-set-faces`. – Stefan Oct 31 '12 at 20:21