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

From: Elijah Gabe Pérez <[email-masked]>
Date: Sat, 29 Mar 2025 11:56:52 -0600

Eli Zaretskii <[email-masked]> writes:

> How long is the post-command-hook list in your production sessions?
> Should we poll users to give their data?  Just yesterday someone
> complained on Reddit that Emacs is too slow, and I have no doubt that
> features that use post-command-hook are at least part of the reason if
> not _the_ reason.

this is what i have in every prog mode:

(eldoc-schedule-timer
 treesit-fold-indicators--post-command
 jit-lock--antiblink-post-command
 fill-indicator--set-warning
 indent-bars--highlight-current-depth
 goggles--post-command
 corfu--auto-post-command
 yas--post-command-handler
 whitespace-post-command-hook
 t
 eldoc-box--follow-cursor)

Most of these functions uses this hook for run code when cursor changes
position since there is not a hook for that (yet).

I think there should be a entry in etc/TODO for hooks when:
 - buffer content changes
 - cursor changes position
 - undo (and redo) commands are used.
 - rendering/displaying frame content (thus the code would not run for every function).

This would reduce post-command-hook usage and help Emacs ecosystem a lot.

-- 
                                          - E.G via GNU Emacs and Org.