GNU bug report logs -
#24830
[PATCH] Add an example for font-lock-remove-keywords.
Previous Next
Reported by: Hong Xu <hong <at> topbug.net>
Date: Sun, 30 Oct 2016 23:26:01 UTC
Severity: wishlist
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24830 in the body.
You can then email your comments to 24830 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24830
; Package
emacs
.
(Sun, 30 Oct 2016 23:26:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Hong Xu <hong <at> topbug.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 30 Oct 2016 23:26:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
---
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 <at> topbug.net>
+
+ * modes.texi (Customizing Keywords): Add an example for `font-lock-remove-keywords'.
+
2015-03-29 Glenn Morris <rgm <at> 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 sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Fri, 04 Nov 2016 09:21:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Hong Xu <hong <at> topbug.net>
:
bug acknowledged by developer.
(Fri, 04 Nov 2016 09:21:01 GMT)
Full text and
rfc822 format available.
Message #10 received at 24830-done <at> debbugs.gnu.org (full text, mbox):
> From: Hong Xu <hong <at> topbug.net>
> 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 <at> topbug.net>
> +
> + * modes.texi (Customizing Keywords): Add an example for `font-lock-remove-keywords'.
> +
Thanks. I added the caveat to the documentation of
'font-lock-remove-keywords'. I don't see a particular need to have an
example for its use, as just saying the argument 'keywords' should be
identical to what was used by 'font-lock-add-keywords' seems to be
enough.
With that, I'm closing the bug report. Thanks.
Btw, you are encouraged to start the legal paperwork for assigning
copyright of your contributions to the FSF, so that we could accept
your contributions without any limitations.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24830
; Package
emacs
.
(Fri, 04 Nov 2016 20:14:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 24830-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-11-04 Fri 02:20 GMT-0700, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Btw, you are encouraged to start the legal paperwork for assigning
> copyright of your contributions to the FSF, so that we could accept
> your contributions without any limitations.
Thanks, I'm glad to do that. It looks like a maintainer need to me the
template for assignment...
Hong
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 03 Dec 2016 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 252 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.