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: Raffaele Ricciardi
Subject: Re: How to add syntax-highlighting to a Help buffer?
Date: Sat, 4 Jul 2015 19:29:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

On 04/07/15 17:25, Michael Heerdegen wrote:
> `font-lock-mode' is not so useful for the fontification of Help buffers,
> so it makes sense not to use it.  For highlighting regexps, as in your
> examples, hi-lock is just fine.  *Help* is mostly text, not code.

I thought that Help buffers relied on Font Lock Mode because -- in a
Help buffer -- `C-h v font-lock-mode RET' replied:

    Its value is t
    Local in buffer *Help*; global value is nil

    Non-nil if Font-Lock mode is enabled.

Had the value of `font-lock-mode' been `nil', I would have thought
otherwise.

OTOH the code could be easily rewritten to use font-lock-mode and
propertize via the font-lock-face text property.

Now that I have understood how things work, I doubt that it would be
beneficial to use Font Lock Mode in Help buffers, because the text could
be mixed (for example: Emacs Lisp code and regular text).  Therefore, it
makes sense to highlight each portion of text in an specific way, as
Emacs does now.



reply via email to

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