GNU bug report logs -
#77224
[PATCH] New minor mode 'cursor-indicators-mode'
Previous Next
Full log
View this message in rfc822 format
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> Cc: eg642616 <at> gmail.com, 77224 <at> debbugs.gnu.org, juri <at> linkov.net
> Date: Thu, 27 Mar 2025 21:17:25 +0100
>
> Here we discuss changing only the color of the cursor, a much much less
> complex operation.
My point is that when the list on post-command-hook is long, it takes
Emacs time to process all the functions on the list, and the longer
the list, the less responsive Emacs will be. These small
insignificant delays add up.
How long is the post-command-hook list in your production sessions?
Should we poll users to give their data? Just yesterday someone
complained on Reddit that Emacs is too slow, and I have no doubt that
features that use post-command-hook are at least part of the reason if
not _the_ reason.
So I maintain that we should try to avoid post-command-hook for
operations that should happen very rarely (this case is one such case:
we only want to run this code when something is turned on or off).
Even if the reaction to the change is a bit slower, it is worth our
while to pay that price: users will be a tad happier with Emacs
response times. And if there are alternative methods of doing the
same, like the respective mode hooks in this case, we should use them
without thinking twice. Ideally, post-command-hook should only be
used for stuff that really must be done after almost every command;
for any other cases we should look for other Emacs features to do the
job.
Emacs is a very old program, and if we do it right, it will live a
long time since. We should realize the long-run effects of (ab)using
stuff like post-command-hook, and try to imagine how much more stuff
will be accrued in post-command-hook 40 years hence if we lower our
guards in this regard.
But I repeat myself.
This bug report was last modified 64 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.