GNU bug report logs -
#77224
[PATCH] New minor mode 'cursor-indicators-mode'
Previous Next
Full log
Message #62 received at 77224 <at> debbugs.gnu.org (full text, mbox):
> > > I see your point about sluggishness and I am very careful myself to not
> > > enable modes which add expensive computations to the
> > > `post-command-hook'. Nevertheless in this case using the
> > > `post-command-hook' is the right thing, such that the `cursor-type' is
> > > changed effective immediately, as had been done before in CUA, see
> > > `cua--post-command-handler-1'. The computation in this case is not
> > > expensive.
> >
> > I disagree that the cursor must change "immediately", in the rigorous
> > sense of that word. I think if it changes after 10 or 20 or 50
> > milliseconds, that's "immediately" for any practical purpose.
>
> Btw, a possibly even better way is to modify the cursor looks from the
> hooks of the relevant commands, like overwrite-mode. If some of them
> don't have a hook, we could add a hook. This is better because it
> doesn't unnecessarily "punish" Emacs anywhere else, only the commands
> that could affect the cursor.
>
> Does this make sense?
It does make sense, to me.
However, FWIW (haven't read all of this thread):
Based on input from Juri and others many moon ago, library `cursor-chg.el' has used pre(post)-command-hook since 2006 to optionally change the cursor shape for overwrite/read-only, idleness, and/or use of an input method. Minor mode `change-cursor-mode' does all but the idleness, which is done by `curchg-toggle-cursor-when-idle'.
I agree with the general motivation not to overuse pre(post)-command-hook, but FWIW I haven't noticed any problems with the use made of it in this case.
https://www.emacswiki.org/emacs/ChangingCursorDynamically
https://www.emacswiki.org/emacs/download/cursor-chg.el
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.