emacs-devel
[Top][All Lists]
Advanced

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

Re: How to let hl-line-mode ignore text with non-default background colo


From: Eli Zaretskii
Subject: Re: How to let hl-line-mode ignore text with non-default background color?
Date: Tue, 09 Jan 2018 21:12:02 +0200

> From: zhang cc <address@hidden>
> CC: "address@hidden" <address@hidden>
> Date: Tue, 9 Jan 2018 06:21:47 +0000
> 1. Open emacs with “-Q” arg
> 2. In the scratch buffer, eval the following form:
> 
> (progn
>   (text-mode)
>   (hl-line-mode)
>   (defface test-face
> '((((class color) (background light))
>        :foreground "darkseagreen2" :background "black")
>       (((class color) (background dark))
>        :foreground "darkolivegreen" :background "white")
>       (t :inverse-video t))
> "test face")
>   (set-text-properties (point-min) (point-max) `(face test-face)))
> 
> 3. Then move cursor across lines in buffer. Foreground color of text is the 
> same as background color set by hl-line-mode, and text can’t be seen.

If you must set the foreground of the text the same as the background
of the hl-line face, then customize the hl-line face to define the
"distant foreground" color for it.  E.g., I defined the "distant
foreground" to be black, and the problem went away.



reply via email to

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