Subject: Re: bug#45763: 27.1; fido-mode does not work with icomplete-in-buffer completion

From: Juri Linkov <[email-masked]>
Date: Mon, 27 Feb 2023 20:41:22 +0200

close 45763 30.0.50
thanks

>> (setq icomplete-in-buffer t)
>> (fido-mode t)
>> type:
>> "(icompl" followed by C-M-i (completion-at-point) 
>> -> default completion is invoked, not fido-mode
>
> It's true, it doesn't.  And either does icomplete-mode.  It's completely
> broken.  Even if I do this to fido-mode, it's still broken, quite
> broken, I don't know how to fix it.
>
> But I would like to fix it, maybe by letting the choice still happen
> from the minibuffer while.  Let's keep this bug open to track this
> development.

I fixed in-buffer completion in the commit a7a984c0ebe.
Now your patch works nicely in fido-mode,
so I pushed it was well, thanks.

> diff --git a/lisp/icomplete.el b/lisp/icomplete.el
> index e06b33e43b..89ace7e434 100644
> --- a/lisp/icomplete.el
> +++ b/lisp/icomplete.el
> @@ -411,9 +411,12 @@ fido-mode
>    :global t :group 'icomplete
>    (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup)
>    (remove-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup)
> +  (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup)
>    (when fido-mode
>      (icomplete-mode -1)
>      (setq icomplete-mode t)
> +    (when icomplete-in-buffer
> +      (add-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup))
>      (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup)
>      (add-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup)))