Subject: Re: bug#41633: Prompts incorrect for multi-occur and multi-isearch when using fido-mode

From: Juri Linkov <[email-masked]>
Date: Wed, 30 Sep 2020 22:08:30 +0300

>> Something like this is needed indeed, not too complicated.
>> If it's not easy to just rephrase the prompt to avoid mentions of
>> the key, then I suggest to display the string returned from
>>
>>   (substitute-command-keys "(\\[exit-minibuffer] to end): ")
>>
>> called in the minibuffer.
>
> Here's a stupid question -- how do you do that?  :-)  I looked around for
> a primitive to eval something in the minibuffer, but I can't find one.

Sorry, I meant just

  (substitute-command-keys "(\\<icomplete-fido-mode-map>\\[icomplete-fido-exit] to end): ")
  => "(M-j to end): "

not necessarily called in the minibuffer, but with the minibuffer's keymap.

A more complex solution like proposed by João would be to set a certain
property set on a command's symbol that exits the minibuffer.

But maybe 'cond' in Andrew's path with an additional substitute-command-keys
(for the case when the user remaps the default keys) is fine.