On 16 Apr 2021, at 00:34, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
Marlon wrote on Thu, Apr 15, 2021 at 21:54:48 +0300:
+that follow the naming pattern tt(prompt_<theme>_<hook>) are automatically

This should be tt(prompt_)var(theme)tt(_)var(hook).

+removed when the prompt theme changes or is disabled.

Add a pointer to the relevant section?  Something like
.
   ifzman(… Manipulating Hook Functions … above)ifnzman(noderef(Manipulating Hook Functions))
.
plus appropriate markup in the first branch.

Done and done.


-       for hook in chpwd precmd preexec periodic zshaddhistory zshexit; do
-         add-zsh-hook -D "${hook}" "prompt_*_${hook}"
+       for hook in chpwd precmd preexec periodic zshaddhistory zshexit \
+           zsh_directory_name; do
+         add-zsh-hook -D "$hook" "prompt_*_$hook"
+       done
+       for hook in isearch-exit isearch-update line-pre-redraw line-init \
+           line-finish history-line-set keymap-select; do
+         add-zle-hook-widget -D "$hook" "prompt_*_$hook"
Hmm.  I'm not at all sure that this is sufficient.  There's a bunch of
reference to precmd and preexec in promptinit; it's possible that some
of these should also handle chpwd,periodic,zshaddhistory,zshexit
(a preëxisting issue) and the add-zle-hook-widget hook classes (an issue
this patch might be introducing).

Attached is a new version of the patch that handles _all the things._ \o/