Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Keep syntax highlighting when highlighting current line

118 views
Skip to first unread message

sim...@gmail.com

unread,
Mar 21, 2012, 6:53:55 PM3/21/12
to
Hello,

I am using the following code to highlight the current line in emacs:

(global-hl-line-mode 1)
(set-face-background 'hl-line "#111")

The problem is that code in the current line will not be highlighted according with the current font-lock mode colors. it's just white on black.

Is there a way to highlight the current line, but keep the syntax highlighting from font-lock?

Thanks!

Joost Kremers

unread,
Mar 22, 2012, 4:21:21 AM3/22/12
to
sim...@gmail.com wrote:
> I am using the following code to highlight the current line in emacs:
>
> (global-hl-line-mode 1)
> (set-face-background 'hl-line "#111")

get rid of the second line and customise the hl-line face (M-x
customize-face RET hl-line RET). disable the inherit feature and set the
background colour to #111. that should leave the foreground colour alone.

HTH

--
Joost Kremers joostk...@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
0 new messages