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

From: Elijah Gabe Pérez <[email-masked]>
Date: Sun, 13 Apr 2025 22:34:47 -0600

Elijah Gabe Pérez writes:

> Eli Zaretskii <[email-masked]> writes:
>
> >> 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?
>
> Maybe in a kind of loop?
> I'm still thinking.
>
> Another idea is to make the cursor color buffer local.

I got an idea, what about add an advice-add to setq as a kind of variable
watcher? setq is the standard for changing the value to a  variable, and
compared to post-command-hook, it wouldn't run on every function calls, ofc
the advice will be removed after disabling the minor mode.

Maybe it sounds hacky and could already been talked about in this thread
that I've missed, but there are built-in packages in emacs that use
advice-add.