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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 27 Mar 2025 21:25:22 +0200

> From: Elijah Gabe Pérez <[email-masked]>
> Cc: Daniel Mendler <[email-masked]>,  [email-masked],
>   [email-masked]
> Date: Thu, 27 Mar 2025 12:27:22 -0600
> 
> Eli Zaretskii <[email-masked]> writes:
> 
>  Anyway, I think making the cursor change from a mode hook is a better
>  solution.
> 
>  As has been mentioned, the problem is that not every scenario is covered
>  by hooks, while the PCH is a potentially universal solution which can
>  check arbitrary conditions. But if hooks work sufficiently well for most
>  scenarios, then why not.
> 
>  If there are cases that this indication supports but there's no mode
>  hook for them, let's discuss those cases one by one and see how to
>  solve them. I see overwrite-mode, read-only-mode, and input-method
>  activation, all of which have hooks, AFAIR.
> 
> But the problem with using hooks is that modes sometimes defines a
> specific name for hook or use different hooks for that, for example
> overwrite-mode only defines overwrite-mode-hook, however input-method
> defines input-method-activate-hook and input-method-deactivate-hook or
> mark/region have activate-mark-hook and deactivate-mark-hook.

If there's a single hook, it is called both when turning the mode on
and when turning it off, so I'm not sure I see the problem.

Anyway, I think I'm done arguing.  I'm quite sure you all understand
my opinions and suggestions; if you want to disregard them and use the
post-command-hook anyway, feel free, but don't be surprised if someone
then complains that Emacs became a tad slower: it's because of all
these features that take the easy way out and use post-command-hook,
and by that add yet another one of those small slowdowns, which add up
and up...