Subject: Re: bug#55800: using rgrep function interactively with fido-mode or fido-vertical-mode causes errors

From: Juri Linkov <[email-masked]>
Date: Fri, 10 Jun 2022 10:58:05 +0300

>> This is what it already does: for example, when the current file
>> is in Emacs Lisp mode, then the default is: (default *.el)
>
> If this is an intended behaviour that is considered to be intuitive then
> sorry about the bug report. I was used to how things like  the rg package
> worked and that might have been my fault.

Actually I don't know the intended behaviour of fido-mode, so your
bug report is a valid request to find the source of the problem.
If fido-mode works as intended, then rgrep could be fixed.

> Again it might be my fault but I don't get the "man" example. Doing
> all  what you said and using M-x man only presented a single prompt
> and that prompt had the word under cursor as the default value. If I
> typed nothing the word under cursor(which is displayed in the prompt)
> is chosen as the default but if I typed something it searches the man
> page for that word. I see no highlighting of candidates there.

It looks like your M-x man doesn't find available manual names,
so we need to find a better example.  Here is a plain call
that exposes the problem:

  (completing-read
   (format-prompt "Prompt" "default")
   '("a" "b" "c") nil nil nil nil
   "default")

Without fido-vertical-mode, typing RET returns "default".
With fido-vertical-mode, typing RET returns "a".

So maybe fido-mode could be fixed to always provide the default value
as the first highlighted candidate?  Then RET will select it.