bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15298: 24.3.50; Background color lost when highlighting a string


From: Sebastien Vauban
Subject: bug#15298: 24.3.50; Background color lost when highlighting a string
Date: Fri, 13 Dec 2013 13:50:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

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





reply via email to

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