[Top][All Lists]

[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: Fri, 29 Jan 2010 13:09:05 +0000
User-agent: Mutt/1.5.9i

Hi, Eli,

On Thu, Jan 28, 2010 at 09:18:05PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 28 Jan 2010 14:47:07 +0000
> > Cc: address@hidden, address@hidden
> > From: Alan Mackenzie <address@hidden>

> > > >    (defun foo-before-display (buffer beg end) .....)

> > > > , BEG and END defining the piece of BUFFER about to be displayed.
> > > > The hook would be called before fontification.

> > > What do you mean by ``before fontification'', and why does it have to
> > > be before that?

> > I don't really know what I mean by "before fontification".  I want it
> > so that if in `foo-before-display' I put syntax-table TP on < and >,
> > and point happens to be at one of them, show-paren-mode will work to
> > highlight them.

> Why do you need to do that only when the text is about to be displayed?
> Is it too expensive to do that in the whole buffer or something?

People have complained before about "sluggish start up time" when I've
added things that scan the whole buffer.  Adding 0.5s to startup time
could be serious if you've got 50 big C++ buffers in your .emacs.desktop.
Maybe.  I'm more exploring the possibilities; I might well end up just
scanning the whole buffer - PCs aren't getting any slower as time goes
by.  Currently, the TPs are being added in CC Mode's font locking stuff,
which is kind of irritating (to me at least).

> Anyway, show-paren-mode works off an idle timer, so I think it is
> not necessary to run the kind of function you have in mind before
> redisplay; near its end is okay.

Thanks.  I didn't know that.  Maybe `after-redisplay-functions' is really
what I'm looking for.

> > Maybe an alternative to a hook here would be to allow an application
> > to specify that some text property (say, 'c-templatified) is to be
> > "special", and when the displayer detects the TP has changed, it
> > calls an associated function.  'c-templatified would be analogous to
> > 'fontified.

> Don't we already have text properties that cause Lisp forms to be
> evaluated?

Er, yes.  help-echo, display (as David pointed out).  So it seems I've
got what I need, if I need it.

> And again, why can't you put your text property everywhere in the
> buffer where you want this effect?

I can.  Maybe I will.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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