GNU bug report logs - #77224
[PATCH] New minor mode 'cursor-indicators-mode'

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sun, 23 Mar 2025 22:59:03 UTC

Severity: normal

Tags: patch

Full log


Message #137 received at 77224 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 77224 <at> debbugs.gnu.org, eliz <at> gnu.org, Daniel Colascione <dancol <at> dancol.org>,
 mail <at> daniel-mendler.de
Subject: Re: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'
Date: Fri, 28 Mar 2025 09:30:03 +0200
> I've updated the patch which should use the mode hook instead using
> post-command-hook or idle timers (and allows (implicitly) to user use
> post-command-hook (but that is user responsibility add it or not)).
>
> Also this should refresh the cursor while switching windows.
>
> However I've deleted the function/lambdas support as conditions because
> i found it problematic.
>
> I've test it only for overwrite-mode, I ask if anyone wants to give it a
> try.

Please note that this is insufficient for 'repeat-mode'.
Currently it requires adding an advice to update the cursor
on the repeat timer events:

  (add-function :after repeat-echo-function #'cursor-indicators--update-indications)

since need to update the cursor when the timer is fired:

  (run-with-idle-timer timeout nil #'repeat-exit)
  (defun repeat-exit ()
    (setq repeat-in-progress nil)
    (funcall repeat-echo-function nil))

This problem can be solved by adding a hook:

  (defun repeat-exit ()
    (setq repeat-in-progress nil)
    (funcall repeat-echo-function nil)
    (run-hooks 'repeat-exit-hook))

Then 'cursor-indicators-mode' needs to add this hook:

  (define-minor-mode cursor-indicators-mode
    ...
    (add-hook 'repeat-exit-hook #'cursor-indicators--update-indications)

Then maybe it's possible to add more hooks for other features as well.

The drawback of this approach is that specific hooks make the cursor updating
less reliable than with using post-command-hook.




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.