From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lennart Borgman <lennart.borgman@gmail.com>, emacs-devel@gnu.org
Subject: Doc patch for `fontification-functions': [was: Is there something like `on-display-functions'?]
Date: Thu, 28 Jan 2010 11:30:56 +0000 [thread overview]
Message-ID: <20100128113056.GE2285@muc.de> (raw)
In-Reply-To: <20100127153733.GD3432@muc.de>
Hi, Stefan,
On Wed, Jan 27, 2010 at 03:37:33PM +0000, Alan Mackenzie wrote:
> The documentation (elisp manual) and doc string for this are poor.
> They only say what you should use the hook for, not when it's called.
> In particular, they don't say explicitly what happens when font lock
> isn't enabled, or when a different font-lock-support-mode is active.
> I take it the hook is called regardless of these things.
Here's a patch to fix this. I've also converted some "each function"s
to "the functions [collectively]". May I commit the patch (with a
proper ChangeLog entry, of course)?
=== modified file 'doc/lispref/display.texi'
*** doc/lispref/display.texi 2010-01-13 08:35:10 +0000
--- doc/lispref/display.texi 2010-01-28 11:22:57 +0000
***************
*** 2654,2676 ****
@defvar fontification-functions
This variable holds a list of functions that are called by Emacs
! redisplay as needed to assign faces automatically to text in the buffer.
The functions are called in the order listed, with one argument, a
! buffer position @var{pos}. Each function should attempt to assign faces
! to the text in the current buffer starting at @var{pos}.
! Each function should record the faces they assign by setting the
! @code{face} property. It should also add a non-@code{nil}
! @code{fontified} property for all the text it has assigned faces to.
That property tells redisplay that faces have been assigned to that text
already.
! It is probably a good idea for each function to do nothing if the
character after @var{pos} already has a non-@code{nil} @code{fontified}
property, but this is not required. If one function overrides the
! assignments made by a previous one, the properties as they are
! after the last function finishes are the ones that really matter.
For efficiency, we recommend writing these functions so that they
usually assign faces to around 400 to 600 characters at each call.
--- 2654,2678 ----
@defvar fontification-functions
This variable holds a list of functions that are called by Emacs
! redisplay as needed, just before doing redisplay. They are called even
! when Font-lock isn't enabled. When Font-lock is enabled, this variable
! usually holds just one function, @code{jit-lock-function}.
The functions are called in the order listed, with one argument, a
! buffer position @var{pos}. Collectively they should attempt to assign
! faces to the text in the current buffer starting at @var{pos}.
! The functions should record the faces they assign by setting the
! @code{face} property. They should also add a non-@code{nil}
! @code{fontified} property for all the text they have assigned faces to.
That property tells redisplay that faces have been assigned to that text
already.
! It is probably a good idea for the functions to do nothing if the
character after @var{pos} already has a non-@code{nil} @code{fontified}
property, but this is not required. If one function overrides the
! assignments made by a previous one, the properties as they are after the
! last function finishes are the ones that really matter.
For efficiency, we recommend writing these functions so that they
usually assign faces to around 400 to 600 characters at each call.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2010-01-28 11:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 13:57 Is there something like `on-display-functions'? Alan Mackenzie
2010-01-27 13:53 ` Lennart Borgman
2010-01-27 14:55 ` Alan Mackenzie
2010-01-27 15:11 ` Stefan Monnier
2010-01-27 15:37 ` Alan Mackenzie
2010-01-27 17:44 ` Eli Zaretskii
2010-01-27 19:24 ` Stefan Monnier
2010-01-27 20:08 ` Eli Zaretskii
2010-01-27 21:04 ` Stefan Monnier
2010-01-28 6:49 ` Eli Zaretskii
2010-01-28 19:37 ` Stefan Monnier
2010-01-28 20:53 ` Eli Zaretskii
2010-01-28 23:12 ` Stefan Monnier
2010-01-29 9:09 ` Eli Zaretskii
2010-01-29 18:08 ` Stefan Monnier
2010-01-28 6:55 ` Eli Zaretskii
2010-01-28 10:38 ` Alan Mackenzie
2010-01-28 12:54 ` Eli Zaretskii
2010-01-28 14:47 ` Alan Mackenzie
2010-01-28 19:18 ` Eli Zaretskii
2010-01-29 13:09 ` Alan Mackenzie
2010-01-28 19:37 ` Stefan Monnier
2010-01-29 13:17 ` Alan Mackenzie
2010-01-29 18:13 ` Stefan Monnier
2010-01-29 19:17 ` Alan Mackenzie
2010-01-30 21:02 ` Stefan Monnier
2010-01-27 17:55 ` Eli Zaretskii
2010-01-28 10:27 ` Alan Mackenzie
2010-01-28 11:30 ` Alan Mackenzie [this message]
2010-01-28 15:34 ` Doc patch for `fontification-functions': Chong Yidong
2010-01-28 16:40 ` Alan Mackenzie
2010-01-28 18:38 ` Doc patch for `fontification-functions': [was: Is there something like `on-display-functions'?] Eli Zaretskii
2010-01-28 19:44 ` Doc patch for `fontification-functions': Stefan Monnier
2010-01-27 14:16 ` Is there something like `on-display-functions'? alin.s
2010-01-27 14:27 ` David Kastrup
2010-01-27 15:20 ` Alan Mackenzie
2010-01-27 16:31 ` Stephen J. Turnbull
2010-01-27 14:59 ` Davis Herring
2010-01-28 1:41 ` Daniel Colascione
2010-01-28 10:14 ` Alan Mackenzie
2010-01-28 19:39 ` Stefan Monnier
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=20100128113056.GE2285@muc.de \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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.