all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: How to add syntax-highlighting to a Help buffer?
Date: Sat, 04 Jul 2015 13:54:38 -0400	[thread overview]
Message-ID: <jwv3813q0js.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.6317.1436027452.904.help-gnu-emacs@gnu.org

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


      parent reply	other threads:[~2015-07-04 17:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03  7:59 How to add syntax-highlighting to a Help buffer? Raffaele Ricciardi
2015-07-03  9:20 ` Vaidheeswaran C
2015-07-03 20:09 ` Emanuel Berg
2015-07-03 23:22 ` Michael Heerdegen
2015-07-04 15:09   ` Emanuel Berg
2015-07-04 15:25     ` Michael Heerdegen
2015-07-04 23:24       ` Emanuel Berg
2015-07-04 16:30     ` tomas
2015-07-04 23:25       ` Emanuel Berg
     [not found]     ` <mailman.6316.1436023528.904.help-gnu-emacs@gnu.org>
2015-07-04 17:29       ` Raffaele Ricciardi
2015-07-04 17:43         ` Michael Heerdegen
2015-07-04 23:31         ` Emanuel Berg
     [not found]     ` <mailman.6317.1436027452.904.help-gnu-emacs@gnu.org>
2015-07-04 17:54       ` Stefan Monnier [this message]

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=jwv3813q0js.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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.