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: zhang cc
Subject: Re: How to let hl-line-mode ignore text with non-default background color?
Date: Tue, 9 Jan 2018 06:21:47 +0000


On 9 Jan 2018, 11:46 AM +0800, Eli Zaretskii <address@hidden>, wrote:
From: zhang cc <address@hidden
Date: Tue, 9 Jan 2018 02:25:10 +0000

Text with face custom background color or with inverse-video be set.

These text usually is important ones like TODO in org-mode or matched words in search result. But
hl-line-mode makes them can’t be seen clearly which is annoying.

Please show an example of this. I don't see a problem with the
default face definitions, at least not with display of search matches.
(I've read the stack-overflow question, and I still am not sure what
is the problem, since hl-line's background is rather light, and should
be very different from any reasonable foreground.) Maybe you use some
theme that is a factor here, or maybe your face customizations are
involved.

IOW, please show a complete recipe for reproducing the problem (it is
also advisable to post that with "M-x report-emacs-bug RET", so the
issue is recorded by the Emacs issue tracker).

Thanks.


Yes, it is face related. And hl-line can dim good faces (often for highlight use).

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.



reply via email to

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