emacs-devel
[Top][All Lists]
Advanced

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

Re: First fontification of a buffer happens before font lock is fully in


From: Stefan Monnier
Subject: Re: First fontification of a buffer happens before font lock is fully initialised.
Date: Tue, 07 Feb 2012 13:02:07 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

>> Some other thoughts:
>> - use some trick to delay the fontification to after the minor-mode hook
>> is run (e.g. add to post-command-hook or something like that).
>> post-command-hook is not a good choice and I can't think of much
>> better, so maybe this is out.
> post-command-hook _is_ ugly, and we don't want one-time code running
> in it.

post-command-hook is often used for "one-time code", actually (e.g. for
define-globalized-minor-mode).

> Can we not trust the good taste and sense of hackers generally?

Have you ever looked at the Elisp code out there ;-)?

> We can certainly trust the Emacs developers.

I certainly wouldn't.  Especially not the maintainers.

>> But maybe we can have an :after-hook.  Some major modes would also
>> appreciate such a feature, so maybe this same arg can be added to
>> both define-minor-mode and define-derived-mode.
> Or, perhaps, even (defmacro run-hooks-here () ...), which would preserve
> the order of the initialisation forms in the mode.  But I'd be happy
> enough with :after-hook.  Would you like me to implement it?

Ah, yes, some way to force "run it here rather than elsewhere" would
be elegant.  The problem, is how to implement it in a way that's not
completely disgusting.
The :after-hook has the advantage of being straightforward.

If we want to fix it for 24.1, "straightforward" is important.

Patch welcome, either way,


        Stefan



reply via email to

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