As an example, if I start a one line comment:
;; Comment⏎
Emacs will fontify the the whole line, from the beginning of line, occupying the entire width of the window, as comment. This can be made easily visible by setting a background color for the comments.
Is there a way to make emacs only fontify the part of the line that's not empty?
Edit: This is the default behavior of emacs, and not a problem with the init file. You can see this by starting emacs with emacs -Q
, open a lisp file, and then (set-face-background 'font-lock-comment-face "yellow")
(Thanks @lawlist)
extend_face_to_end_of_line
when working on my own feature requests. If fiddling around with Lisp is insufficient to meet your needs and if you are so inclined, you may be interested in playing with the aforementioned internal functionM-x find-library RET simple RET
. Evaluate(set-face-background 'font-lock-comment-face "yellow")
. The yellow background face extends to the end of the line for all comments.