unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: kai.grossjohann@gmx.net (Kai Großjohann)
Cc: Mayer Goldberg <gmayer@cs.bgu.ac.il>
Subject: Doc extension: document font-lock patterns for font-lock-add-keywords
Date: Fri, 27 Jun 2003 22:09:53 +0200	[thread overview]
Message-ID: <84r85fqo32.fsf@lucy.is.informatik.uni-duisburg.de> (raw)

Mayer Goldberg <gmayer@cs.bgu.ac.il> pointed out to me that the Emacs
info file does not explain the syntax of the patterns arg for
font-lock-add-keywords.  I tried to describe the most common usage
(leaving all the gory details to the lispref) and have concocted the
following patch.  It also xrefs the relevant documentation.

OK to install?

Kai (not quite sure how to proceed with doc fixes)

cvs server: Diffing man
Index: man/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/man/ChangeLog,v
retrieving revision 1.186
diff -u -r1.186 ChangeLog
--- man/ChangeLog	17 Jun 2003 14:05:19 -0000	1.186
+++ man/ChangeLog	27 Jun 2003 20:06:31 -0000
@@ -1,3 +1,8 @@
+2003-06-27  Kai Gro^[,A_^[(Bjohann  <kai.grossjohann@gmx.net>
+
+	* display.texi (Font Lock): Explain highlighting patterns for
+	font-lock.
+
 2003-06-17  Kai Gro^[,A_^[(Bjohann  <kai.grossjohann@gmx.net>
 
 	Version 2.0.35 of Tramp released.
Index: man/display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/man/display.texi,v
retrieving revision 1.68
diff -u -r1.68 display.texi
--- man/display.texi	4 Feb 2003 14:53:27 -0000	1.68
+++ man/display.texi	27 Jun 2003 20:06:34 -0000
@@ -317,6 +317,28 @@
   To remove keywords from the font-lock highlighting patterns, use the
 function @code{font-lock-remove-keywords}.
 
+@cindex font-lock highlighting pattern
+  Normally, the highlighting patterns will have the structure
+@code{(@var{regexp} @var{match} @var{face} @var{override})}.  Here,
+@var{regexp} gives the regular expression to match.  It might use
+subexpressions (@code{\\(...\\)}); @var{match} specifies which of the
+subexpressions are to be highlighted.  Zero means to highlight the match
+of the whole regular expression, positive numbers specify the pair of
+parentheses to highlight.  (The open parentheses are counted left to
+right to give the number.)  @var{face} specifies the face to use; type
+@kbd{M-x list-faces-display @key{RET}} for a list of available faces.
+Finally, @var{override} equals t means to override any previously
+specified fontification; `keep' means to
+highlight only unfontified parts; `prepend' means to merge with
+existing fontification where the new fontification takes precedence;
+and finally, `append' means to merge with existing fontififcation where
+the existing fontification takes precedence.
+
+  Complete documentation on the patterns can be found in the
+documentation for the variable @code{font-lock-keywords}, and also in
+the Emacs Lisp Reference Manual, @xref{Search-based
+Fontification,,elisp}.
+
 @cindex just-in-time (JIT) font-lock
 @cindex background syntax highlighting
   Fontifying large buffers can take a long time.  To avoid large


-- 
~/.signature

                 reply	other threads:[~2003-06-27 20:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84r85fqo32.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@gmx.net \
    --cc=gmayer@cs.bgu.ac.il \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).