GNU bug report logs - #15298
24.3.50; Background color lost when highlighting a string

Previous Next

Package: emacs;

Reported by: "Sebastien Vauban" <sva-news <at> mygooglest.com>

Date: Sat, 7 Sep 2013 10:48:01 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 15298 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 15298 <at> debbugs.gnu.org
Subject: Re: bug#15298: 24.3.50;
 Background color lost when highlighting a string
Date: Fri, 13 Dec 2013 13:50:26 +0100
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




This bug report was last modified 11 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.