emacs-devel
[Top][All Lists]
Advanced

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

Re: Is there something like `on-display-functions'?


From: Alan Mackenzie
Subject: Re: Is there something like `on-display-functions'?
Date: Wed, 27 Jan 2010 15:37:33 +0000
User-agent: Mutt/1.5.9i

Hi, Stefan,

On Wed, Jan 27, 2010 at 10:11:27AM -0500, Stefan Monnier wrote:
> >> Is there some hook called each time something's about to be
> >> displayed on the screen (regardless of whether or not font-lock is
> >> enabled)?

> There's fontification-functions, which is the hook around which
> jit-lock is implemented.  

Thanks for this tip.

The documentation (elisp manual) and doc string for this are poor.  They
only say what you should use the hook for, not when it's called.  In
particular, they don't say explicitly what happens when font lock isn't
enabled, or when a different font-lock-support-mode is active.  I take it
the hook is called regardless of these things.

> I'd recommend you use jit-lock instead (via jit-lock-register), tho,
> because fontification-functions (despite its name) really only works
> well with a single function (at least I don't know how to make it work
> well with more than one, based on how it's currently defined).

Is that because it's got to set 'fontified' properties?

> >> If there is, I could use it to apply the appropriate text properties
> >> to C++ template delimiters as they're about to be displayed, thus
> >> potentially speeding up startup for C++ (and like languages).

> Of course, if these are syntax-table properties, it will not solve all
> problems, since the buffer-movement may still get buggy when it depends
> on text that hasn't been displayed yet.

No, that's OK.  C++'s template delimiters < > cannot enclose a brace or
semicolon, so their effect is local.  I would set these properties on
complete "blocks" (regions delimited by {, }, ;).

> >> Yes, I've tried searching for it and not found it.
> > Just curious, but why don't you want to use font-lock for it?

> He probably wants it to work even when font-lock is disabled.

Indeed.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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