[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24830: [PATCH] Add an example for font-lock-remove-keywords.
From: |
Hong Xu |
Subject: |
bug#24830: [PATCH] Add an example for font-lock-remove-keywords. |
Date: |
Sun, 30 Oct 2016 16:24:47 -0700 |
---
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#24830: [PATCH] Add an example for font-lock-remove-keywords.,
Hong Xu <=