From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: Glenn Morris <rgm-mXXj517/zsQ@public.gmane.org>
Cc: 15298-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org
Subject: bug#15298: 24.3.50; Background color lost when highlighting a string
Date: Fri, 13 Dec 2013 13:50:26 +0100 [thread overview]
Message-ID: <86wqj8kj8t.fsf@somewhere.org> (raw)
In-Reply-To: <mailman.6032.1384401725.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org> (Glenn Morris's message of "Wed, 13 Nov 2013 23:01:45 -0500")
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
next prev parent reply other threads:[~2013-12-13 12:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-07 10:45 bug#15298: 24.3.50; Background color lost when highlighting a string Sebastien Vauban
2013-11-14 4:01 ` Glenn Morris
[not found] ` <mailman.6032.1384401725.10748.bug-gnu-emacs@gnu.org>
[not found] ` <mailman.6032.1384401725.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2013-12-13 12:50 ` Sebastien Vauban [this message]
2013-12-13 14:11 ` Eli Zaretskii
2013-12-13 16:14 ` Josh
2013-12-13 18:45 ` Eli Zaretskii
2013-12-13 20:21 ` Josh
[not found] ` <mailman.9107.1386943937.10748.bug-gnu-emacs@gnu.org>
[not found] ` <mailman.9107.1386943937.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2013-12-13 15:41 ` Sebastien Vauban
2013-12-13 16:08 ` Eli Zaretskii
2013-12-13 16:41 ` Stefan Monnier
[not found] ` <jwvk3f83dsp.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
2013-12-13 19:02 ` Sebastien Vauban
2013-12-14 2:17 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86wqj8kj8t.fsf@somewhere.org \
--to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
--cc=15298-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org \
--cc=rgm-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.