GNU bug report logs -
#77224
[PATCH] New minor mode 'cursor-indicators-mode'
Previous Next
Full log
Message #122 received at 77224 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Would it be better to use an idle timer instead? post-command-hook
> tends to make Emacs sluggish.
post-command-hook is the most general, and thus the simplest way to
implement something like this, but not necessarily a good way. A
solution using such a general tool like post-command-hook also comes
with problems. What if something adds something to post-command-hook
that changes one of the conditions that should trigger a cursor type
change? And yes, obviously, the conditions are checked much too often
when using post-command-hook, and yes, people will complain because they
are will add conditions where checking is not that cheap.
Timers are a bit better, but are also far from optimal.
I would really prefer to use other hooks. If we miss a hook, let's add
those hooks we miss.
Nearly all uses of hooks could be replaced by adding something to
post-command-hook, but the other hooks are there for a reason. What's
different in this case that justifies this measure here (the question
does not go to Eli, obviously)?
If we can't use other hooks, are there other alternatives? Variable
watchers have been mentioned - would using those be possible? Or, could
we at least try to use the buffer local binding of post-command-hook, at
least for conditions that are buffer local anyway?
Michael.
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.