Subject: bug#77224: [PATCH] New minor mode 'cursor-indicators-mode'

From: Eli Zaretskii <[email-masked]>
Date: Tue, 01 Apr 2025 14:42:58 +0300

> From: Elijah Gabe Pérez <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked],
>   [email-masked]
> Date: Mon, 31 Mar 2025 17:41:15 -0600
> 
> Eli Zaretskii <[email-masked]> writes:
> 
>  Let's please discuss your ideas before you implement them, to make
>  sure you don't work on some ideas that we might object to.
> 
> Sure.
> 
> The code needs to run each time the cursor moves, (is there
> a function/code that do this?) and each time user changes window
> (because cursor color is not buffer-local).

I understand the general idea, but did you have more detailed ideas
for how to implement that?

And I'm not sure I understand why cursor movement needs this to run,
since the cursor appearance doesn't depend on its position, it depends
on state of overwrite-mode, buffer-read-only, and other similar state
variables, which don't change with buffer or cursor position.  So what
am I missing?

> I think that using variable watchers would be better and keep
> this defcustom (it will only use variables):
> 
> 
> (defcustom cursor-indicators
>   '((overwrite-mode . "red")
>     (buffer-read-only "green" hollow)
>     (current-input-method . "blue"))
>     [...]

If each state has a variable you can watch, then yes.