all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: font-lock-extend-region-function: Final refinements.
Date: Mon, 7 Aug 2006 23:49:15 +0100	[thread overview]
Message-ID: <20060807224915.GA1909@muc.de> (raw)
In-Reply-To: <jwvu04ola7y.fsf-monnier+emacs@gnu.org>

Evening, Stefan!

On Mon, Aug 07, 2006 at 01:45:02PM -0400, Stefan Monnier wrote:

[ .... ]

> If you mean a major mode "Foo", then no: major modes typically don't
> use jit-lock: they use font-lock (which may or may not internally use
> jit-lock, but that's mostly none of their business, unless they fiddle
> with font-lock-support-mode).

OK.

> > Are you saying that j-l-a-c-extend-region-f is a hook purely for the
> > use of font-lock itself (i.e. only in the three files font-lock.el,
> > font-core.el and jit-lock.el)?

> And glasses.el, yes.

glasses.el is a really neat mode!

> > I'm fairly confused at the moment, particularly by some of the
> > function names.  For example, what does the "jit-lock" part of the
> > name `font-lock-extend-jit-lock-region-after-change' mean?  Does it
> > mean that this function only gets called when jit-lock is active?

> Yes.

> > Could you possibly give these new functions doc strings (or even
> > comments) which explain the context in which they're called?

> It's on the way.

Thanks.

> > But I'm not sure you've answered my question; if you have, I've not
> > understood the answer.  So let me ask it again: why are there two
> > separate hooks for extending the region after a buffer change [that's
> > jit-lock-after-change-region-functions and
> > font-lock-extend-after-change-region-function]?

> Because you can use jit-lock without font-lock and vice-versa.  One is
> for jit-lock clients (e.g. font-lock), and the other for font-lock
> clients (e.g. c-mode).

EUREKA!!!  I hadn't realised that jit-lock could be used for things other
than fontification.  You just have to stuff a different function, such as
the glasses one, into `jit-lock-functions'.  Thanks for the
clarification!

Actually, there are places, quite a lot of them, in jit-lock.el (e.g. the
doc string for j-l-after-change-extend-r-f) which explicitly refer to
fontification.  Maybe these could be reformulated with words more
accurate and more abstract than "fontify".

> > Again, would it be possible to simplify the whole mechanism by using
> > only one of the pairs `font-lock-beg/end' and `jit-lock-start/end'?

> Why would you care?
> c-mode should never need to know about jit-lock-(beg|end).

I'm happy about that!

>         Stefan

-- 
Alan.

      reply	other threads:[~2006-08-07 22:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-30 12:48 font-lock-extend-region-function: Final refinements Alan Mackenzie
2006-04-30 14:55 ` Stefan Monnier
2006-04-30 20:54 ` Richard Stallman
     [not found] ` <jwv8xm6p9jx.fsf-monnier+emacs@gnu.org>
     [not found]   ` <20060803163040.GC1282@muc.de>
     [not found]     ` <jwvirl9llf2.fsf-monnier+emacs@gnu.org>
2006-08-04  8:55       ` Alan Mackenzie
2006-08-04 14:59         ` Stefan Monnier
2006-08-06 13:48           ` Alan Mackenzie
2006-08-07 17:45             ` Stefan Monnier
2006-08-07 22:49               ` Alan Mackenzie [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=20060807224915.GA1909@muc.de \
    --to=acm@muc.de \
    --cc=emacs-devel@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.