Subject: bug#72176: 30.0.60; icomplete-vertical-mode failed to work with Error

From: Eli Zaretskii <[email-masked]>
Date: Sat, 20 Jul 2024 09:05:16 +0300

> From: Robert Pluim <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 19 Jul 2024 09:15:49 +0200
> 
> >>>>> On Thu, 18 Jul 2024 18:34:35 +0300, Eli Zaretskii <[email-masked]> said:
> 
>     Eli> (I tested on GNU/Linux as well, and couldn't reproduce.)  Why does it
>     Eli> happen to you and not to others?  What conditions should happen and
>     Eli> how to modify the recipe to reproduce this?
> 
> If I start emacs from "~", it doesnʼt happen, if I start it from eg
> "~/repos/emacs-30" via "src/emacs -Q" then it does happen.

Thanks.  I've applied the trivial band-aid on emacs-30 to avoid the
error in post-command-hook, but the real problem is not in the
function that signals the error, it's in icomplete.el where it calls
the lazy-highlight code.  The evidence is that after the fix, the
display shown in those cases that caused the error is not the expected
one, unless you set icomplete-tidy-shadowed-file-names non-nil.  It
sounds like the problem happens specifically when the minibuffer text
begins with a "~/" and there's another "~/" later in the minibuffer,
the one the user types: the code probably doesn't expect that.

Adding João, who I think wrote this code.