[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display line number on each buffer line
From: |
Michael Heerdegen |
Subject: |
Re: Display line number on each buffer line |
Date: |
Sat, 04 Dec 2021 00:47:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
fatiparty--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
> I think emacs can distinguish between light and dark background. How
> does one adapt the colours so they are different on light and dark
> frame backgrounds, for reasons of legibility?
I do it like this:
(face-spec-set 'line-number
'((((class color) (background dark))
:foreground "red" :height .6)
(((class color) (background light))
:foreground "tan" :height .6))
'face-defface-spec)
The syntax of face specs is documented in the manual.
For finding good colors you can either try colors interactively with the
customize interface without saving and then copy the color names. Also
inheriting from other faces is possible, like this:
(face-spec-set 'line-number
'((t :inherit font-lock-comment-face))
'face-defface-spec)
This is more appropriate when defining new faces, though.
If you don't want to rely on the custom save file, and you also don't
want to clobber your init file with face settings, an alternative is to
define your own custom theme - see
(info "(elisp) Custom Themes")
Michael.
- Re: Display line number on each buffer line, (continued)
- Re: Display line number on each buffer line, Lars Ingebrigtsen, 2021/12/02
- Message not available
- Display line number on each buffer line, fatiparty, 2021/12/02
- Re: Display line number on each buffer line, Michael Heerdegen, 2021/12/02
- Re: Display line number on each buffer line, Eli Zaretskii, 2021/12/02
- Re: Display line number on each buffer line, Michael Heerdegen, 2021/12/02
- Display line number on each buffer line, fatiparty, 2021/12/03
- Re: Display line number on each buffer line,
Michael Heerdegen <=
- Re: Display line number on each buffer line, Philip Kaludercic, 2021/12/02
- Re: Display line number on each buffer line, Jean Louis, 2021/12/03