From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to let hl-line-mode ignore text with non-default background color? Date: Tue, 09 Jan 2018 21:12:02 +0200 Message-ID: <83tvvu6e4d.fsf@gnu.org> References: <83d12j7l0b.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1515525033 23819 195.159.176.226 (9 Jan 2018 19:10:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 Jan 2018 19:10:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: zhang cc Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 09 20:10:29 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYzI4-0005lY-0n for ged-emacs-devel@m.gmane.org; Tue, 09 Jan 2018 20:10:28 +0100 Original-Received: from localhost ([::1]:41749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYzK1-0005Dh-VU for ged-emacs-devel@m.gmane.org; Tue, 09 Jan 2018 14:12:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYzJu-0005CP-Bp for emacs-devel@gnu.org; Tue, 09 Jan 2018 14:12:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYzJr-0001AP-3c for emacs-devel@gnu.org; Tue, 09 Jan 2018 14:12:22 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYzJr-0001AI-1J; Tue, 09 Jan 2018 14:12:19 -0500 Original-Received: from [176.228.60.248] (port=1383 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYzJp-0000aJ-4p; Tue, 09 Jan 2018 14:12:18 -0500 In-reply-to: (message from zhang cc on Tue, 9 Jan 2018 06:21:47 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221765 Archived-At: > From: zhang cc > CC: "emacs-devel@gnu.org" > 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.