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

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

Re: How to add syntax-highlighting to a Help buffer?


From: Stefan Monnier
Subject: Re: How to add syntax-highlighting to a Help buffer?
Date: Sat, 04 Jul 2015 13:54:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

There are 2 "font-lock"s:

- the font-lock-mode minor mode is used to control whether to highlight
  or not.  IOW it's the way the user tells Emacs whether she wants
  things to be "colorized/highlighted/fontlocked/younameit".
- font-lock.el provides a functionality to automatically
  highlight/colorize/fontlock based on the buffer's content.

At some point in time the two were one and the same.  But there are
cases where it's easier to add the highlighting as part of the creation
of the buffer's content rather than separately (where we'd have to
re-discover what that buffer's content mean in order to highlight it
correctly).  So there were modes that highlighted their content without
resorting the to font-lock machinery.  Since then we've tried to unify
the two using the `font-lock-face' property: you can add this property
to your buffer while filling it, and if the user enables font-lock-mode
then this property will be "displayed" whereas if font-lock-mode is off
then this property stays dormant.

For some reason (not sure why) help-mode does not use the font-lock
machinery, so it could/should use the font-lock-face property, but it
has not been updated to that yet.


        Stefan


reply via email to

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