[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Emacs pretest: highlight line number in display-line-numbers-mode?

From: Drew Adams
Subject: RE: Emacs pretest: highlight line number in display-line-numbers-mode?
Date: Thu, 19 Oct 2017 10:18:25 -0700 (PDT)

> > Is there a way to highlight the current line number on the fringe in a
> > different face where the cursor is?  Like hl-line-mode except just the
> > line number is bold or in a different colour?
>         Face: line-number-current-line (sample) (customize this face)

(The line number is not actually in the fringe, BTW.)

Not that I really care, for myself, as I don't use line-number
display, but this is yet another case of the misguided (IMHO)
use of a face that does not appear differently from others by

If the default value of face `line-number-current-line'
looked different from that of face `line-number' then
there would be little need to pose the question of whether
you can highlight the current line number differently.
The only question then might be how to do so.

(I have never understood why Emacs sometimes chooses to
provide a face and yet "hide" it from users by default.
That seems very wrong.)

An additional problem (is there a good answer here?) is that
this face is used in a place where you cannot put the cursor
and use `C-u C-x =' to find out what the face is.

To find the face used, I use `list-faces-display' and look
for either a face name that is a likely candidate
(`line-number' is pretty obvious, in this case) or a face
appearance that matches what I see.

Maybe we could have a mouse command (e.g. bound to some
prefix key plus a mouse click) that would let you get the
same info that `C-u C-x =' provides by clicking in (at
least some) places where there is no text?

But it doesn't seem like a click on a displayed line number
registers a particular event that is different from clicking
on nearby buffer text (unlike the case for clicking in the
fringe, for instance), so perhaps this is not feasible for
at least some click spots.  Still, it would presumably be
possible for some such non-text spots, such as the fringe.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]