From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.bugs Subject: bug#15298: 24.3.50; Background color lost when highlighting a string Date: Fri, 13 Dec 2013 13:50:26 +0100 Organization: Sebastien Vauban Message-ID: <86wqj8kj8t.fsf@somewhere.org> References: <86d2oksye6.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386939131 5784 80.91.229.3 (13 Dec 2013 12:52:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Dec 2013 12:52:11 +0000 (UTC) Cc: 15298-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Fri Dec 13 13:52:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VrSE5-0001AT-J4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 13:52:17 +0100 Original-Received: from localhost ([::1]:42090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrSE5-0004o6-6L for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 07:52:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrSDx-0004hY-7S for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Fri, 13 Dec 2013 07:52:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrSDr-0000bo-2d for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Fri, 13 Dec 2013 07:52:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrSDq-0000bk-Vw for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Fri, 13 Dec 2013 07:52:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VrSDq-0008QD-2P for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Fri, 13 Dec 2013 07:52:02 -0500 X-Loop: help-debbugs-mXXj517/zsQ@public.gmane.org Resent-From: "Sebastien Vauban" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org Resent-Date: Fri, 13 Dec 2013 12:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs-mXXj517/zsQ@public.gmane.org X-GNU-PR-Message: followup 15298 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 15298-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org id=B15298.138693908732321 (code B ref 15298); Fri, 13 Dec 2013 12:52:02 +0000 Original-Received: (at 15298) by debbugs.gnu.org; 13 Dec 2013 12:51:27 +0000 Original-Received: from localhost ([127.0.0.1]:46674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrSDG-0008PE-CC for submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Fri, 13 Dec 2013 07:51:26 -0500 Original-Received: from dd5e0353a.access.telenet.be ([213.224.53.58]:53488 helo=mail.missioncriticalit.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrSDC-0008P1-6B for 15298-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Fri, 13 Dec 2013 07:51:23 -0500 Original-Received: from MUNDANEUM.i-did-not-set--mail-host-address--so-tickle-me (unknown [10.10.10.51]) by mail.missioncriticalit.com (Postfix) with ESMTPS id 9C3425009A5; Fri, 13 Dec 2013 13:53:59 +0100 (CET) X-Url: Under construction... X-Archive: encrypt In-Reply-To: (Glenn Morris's message of "Wed, 13 Nov 2013 23:01:45 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-BeenThere: debbugs-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.bugs:81873 Archived-At: Glenn Morris wrote: > (font-lock-add-keywords 'foo-mode '(("bar" 0 'underline prepend))) > > Eval that, M-x foo-mode, enter > > FOO text bar text > > As soon as "bar" is entered, "FOO..." loses its highlighting. > > It works if you use instead: > > (font-lock-add-keywords 'foo-mode '(("bar" 0 'underline prepend)) 'end) > > Another approach that works is: > > (define-derived-mode foo-mode nil "foo" > "foo doc" > (set (make-local-variable 'font-lock-defaults) > '((("^FOO.*" 0 'foo append))))) ; note addition of "append" here > > (font-lock-add-keywords 'foo-mode '(("bar" 0 'underline))) > > So I think this is not a bug, just a confusing aspect of the way > font-lock-keywords is applied in order. Side question: when we observe such a word which is not highlighted as we expect it, is there a way to see the list of all applied faces in the order they are applied? That'd help debugging such a problem... Best regards, Seb -- Sebastien Vauban