[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
Re: First fontification of a buffer happens before font lock is fully initialised.
Tue, 07 Feb 2012 13:02:07 -0500
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
> 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
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,