[Top][All Lists]

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

bug#5183: 23.1; doc for `font-lock-extra-managed-props'

From: Drew Adams
Subject: bug#5183: 23.1; doc for `font-lock-extra-managed-props'
Date: Fri, 11 Dec 2009 09:54:46 -0800

It is not clear from the doc what this variable does or how it works.
The doc string says:
"Additional text properties managed by font-lock.
This is used by `font-lock-default-unfontify-region' to decide
what properties to clear before refontifying a region."
This speaks only of clearing the properties. It says nothing about how
(re-)fontifying works for such extra properties.
The elisp manual says only this:
"This variable specifies additional properties (other than
`font-lock-face') that are being managed by Font Lock mode.  It is
used by `font-lock-default-unfontify-region', which normally only
manages the `font-lock-face' property.  If you want Font Lock to
manage other properties as well, you must specify them in a
FACESPEC in `font-lock-keywords' as well as add them to this list.
*Note Search-based Fontification::."
Again, the only thing explained is that unfontifying will remove these
properties (along with property `font-lock-face'). There is no real
explanation of how to use this variable wrt fontifying.
And the cross reference doesn't seem to help at all. Node
`Search-based Fontification' does not say anything (that I can find)
about `font-lock-extra-managed-props' or how to make font lock "manage
other properties".
The doc string of `font-lock-keywords' comes the closest to explaining
how to use this variable, as a side note to this paragraph:
"FACENAME is an expression whose value is the face name to use.
Instead of a face, FACENAME can evaluate to a property list of the
form (face FACE PROP1 VAL1 PROP2 VAL2 ...)  in which case all the
listed text-properties will be set rather than just FACE.  In such a
case, you will most likely want to put those properties in
`font-lock-extra-managed-props' or to override
The only place in the Emacs Lisp source code where this variable is
used, besides font-lock.el, is in compile.el. The use there is
somewhat complex, but it seems to be this:
1. `compilation-mode-font-lock-keywords' adds extra properties
(directory message help-echo mouse-face debug) to
`font-lock-keywords', via `compilation-directory-properties'.
2. `font-lock-extra-managed-props' is set to those same properties, so
they will be removed via `font-lock-default-unfontify-region'.
Please explain in the elisp manual how this variable can actually be
used to "manage other properties". Consider adding a simple example -
e.g. a simpler version of what is done in compile.el.

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'

reply via email to

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