bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inadequate description of FUNCTION in elisp font-lock info page


From: Alan Mackenzie
Subject: Inadequate description of FUNCTION in elisp font-lock info page
Date: 6 Dec 2001 22:49:55 +0100
Date: Thu, 6 Dec 2001 20:11:58 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

In the elisp info page "Search-based Fontification" the description of
FUNCTION is this:

`FUNCTION'
     Find text by calling FUNCTION, and highlight the matches it finds
     using `font-lock-keyword-face'.

     When FUNCTION is called, it receives one argument, the limit of
     the search.  It should return non-`nil' if it succeeds, and set the
     match data to describe the match that was found.

I had to look at font-lock.el to work out the complete interface to such
a FUNCTION.  What is missing from the above description is a statement of
how point is to be changed.  It is also not clear, at first reading, that
FUNCTION gets called repeatedly.  I propose the following as an
improvement of the second paragraph:

     When FUNCTION is called, it receives one argument, the limit of the
     search.  Its search should start at point and not extend beyond the
     limit.  FUNCTION should return non-`nil' if it succeeds, and set the
     match data to describe the match that was found.  FUNCTION will be
     called repeatedly with the same limit, and with point where the
     previous invocation left it, until it fails.  It need not reset
     point to a sensible value on failure.

-- 
Alan Mackenzie (Munich, Germany)
Email: address@hidden; to decode, wherever there is a repeated letter
(like "aa"), remove one of them (leaving, say, "a").




reply via email to

[Prev in Thread] Current Thread [Next in Thread]