Subject: bug#34070: 27.0.50; icomplete-mode candidate cycling broken for C-x C-f

From: João Távora <[email-masked]>
Date: Mon, 14 Jan 2019 17:11:58 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: João Távora <[email-masked]>
>> Cc: Drew Adams <[email-masked]>,  [email-masked],  [email-masked]
>> Date: Mon, 14 Jan 2019 16:25:41 +0000
>> 
>> > Please add a test for this, if possible, so that we don't screw this
>> > up again in the future.
>> 
>> I'd love to, but it's not exactly simple to write tests that observe
>> user interaction the minibuffer with ert.  At least for me.  How would I
>> go about doing that?  Any pointers/prior art?
>
> (A stab in the dark) invoke the function bound to TAB and examine what
> it produces?

:-)

Where do you mean TAB?  It's not even in the recipe.  Well I though
about it a bit and can probalby use minibuffer-setup-hook

(let ((minibuffer-setup-hook
       (append minibuffer-setup-hook
               (list (lambda ()
                       ;; commands and observations
                       ))))
      (default-directory source-directory))
  (find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer)))

Don't know how to observe the icomplete candidates though, but this
strategy is probably enough to make a test.  I'd like to push the fix
before that maybe, any objections?

João