all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: 24830@debbugs.gnu.org
Subject: bug#24830: [PATCH] Add an example for font-lock-remove-keywords.
Date: Sun, 30 Oct 2016 16:24:47 -0700	[thread overview]
Message-ID: <1477869887-691-1-git-send-email-hong@topbug.net> (raw)

---
 doc/lispref/ChangeLog.1 |  4 ++++
 doc/lispref/modes.texi  | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/doc/lispref/ChangeLog.1 b/doc/lispref/ChangeLog.1
index 610e7541e7de..34c7b5634359 100644
--- a/doc/lispref/ChangeLog.1
+++ b/doc/lispref/ChangeLog.1
@@ -1,3 +1,7 @@
+2016-10-30  Hong Xu  <hong@topbug.net>
+
+	* modes.texi (Customizing Keywords): Add an example for `font-lock-remove-keywords'.
+
 2015-03-29  Glenn Morris  <rgm@gnu.org>
 
 	* objects.texi (Equality Predicates): Fix typo in example.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 32baa27147bf..04d1f13c60d2 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2930,6 +2930,16 @@ Customizing Keywords
    ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)))
 @end smallexample
 
+To remove the fontification of the word @samp{FIXME} above, use the
+following code.  Note that the list in the argument @var{keywords}
+must be exactly the same as the one added by
+@code{font-lock-add-keywords}.
+
+@smallexample
+(font-lock-remove-keywords 'c-mode
+ '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)))
+@end smallexample
+
 @noindent
 This example affects only C mode proper.  To add the same patterns to C
 mode @emph{and} all modes derived from it, do this instead:
-- 
2.1.4







             reply	other threads:[~2016-10-30 23:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-30 23:24 Hong Xu [this message]
2016-11-04  9:20 ` bug#24830: [PATCH] Add an example for font-lock-remove-keywords Eli Zaretskii
2016-11-04 20:13   ` Hong Xu

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=1477869887-691-1-git-send-email-hong@topbug.net \
    --to=hong@topbug.net \
    --cc=24830@debbugs.gnu.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.