Emacs: change cursor color during active repeat-mode commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-hook 'post-command-hook | |
(defalias 'my/repeat-change-cursor ; change cursor to bar during repeat | |
(let (repeat-p ccol) | |
(lambda () | |
(unless (eq repeat-p repeat-in-progress) | |
(if repeat-in-progress ; turning on | |
(setq ccol (face-background 'cursor))) | |
(setq repeat-p repeat-in-progress) | |
(set-cursor-color | |
(if repeat-in-progress | |
(face-foreground 'error) | |
ccol)))))) | |
90) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After reading u/karthink's great post on simplified home-spun structural editing UIs, I've been playing with repeat-mode. It's trivial to configure a repeat map with a bunch of disparate commands all joined together by some entry binding(s).
The problem, as mentioned in the article, is that you can't tell when repeat mode is active. You just have to remember, unless you notice the message way down in the minibuffer. This contrasts with something like lispy, where you have visual confirmation at point that it's active (i.e. whether point is on a () boundary).
So I whipped this simple fix up: turn the cursor error-red while repeat mode is active. Working well so far.