Subject: bug#55712: 29.0.50; Bad interaction between icomplete and completion-auto-select.

From: Juri Linkov <[email-masked]>
Date: Sun, 29 May 2022 22:55:25 +0300

> (icomplete-mode 1)
> (setopt completion-auto-select t)
> C-x C-f TAB TAB
>
> The following error message is displayed in the minibuffer:
>
> Error in post-command-hook (icomplete-post-command-hook): (wrong-type-argument integer-or-marker-p nil)

I confirm the problem, I have seen it a few times, but
it seems the root of the problem is in the way how buffer-local
hooks are fired.  icomplete-post-command-hook is a hook
local in the minibuffer.  But when the command switches
from the minibuffer to the Completions buffer, then for an unknown
reason the minibuffer post-command hook is still fired in another buffer -
in the Completions buffer that has no local post-command hook.