GNU bug report logs -
#61286
28.2; No visible candidates after toggle icomplete-vertical-mode
Previous Next
Full log
View this message in rfc822 format
tags 61286 notabug
thanks
> From: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
> Date: Sat, 04 Feb 2023 22:51:50 -0300
>
> To reproduce, which is possible with 'emacs -Q', please:
>
> 1. Evaluate the following snippet:
>
> (progn
> (with-eval-after-load 'icomplete
> (define-key icomplete-minibuffer-map (kbd "C-v") #'icomplete-vertical-mode)
> (customize-set-variable 'icomplete-show-matches-on-no-input t))
> (icomplete-mode))
>
> 2. C-x C-f
> 3. C-v (to toggle `icomplete-vertical-mode' while still in the minibuffer).
>
> Results in:
>
> - Only the first candidate can be seen in the vertical list.
>
> Completion works as expected. Quitting and starting a new command, with
> `icomplete-vertical-mode' still enabled, displays the completion
> candidates correctly.
That's because icomplete-vertical-mode adds its own function to
icomplete-minibuffer-setup-hook, but when you invoke C-v in the
minibuffer, that's too late: you already entered the minibuffer, so
the minibuffer is not set up as icomplete-vertical-mode expects.
To solve this, bind C-v to a command that does what
icomplete--vertical-minibuffer-setup does, in addition to turning on
icomplete-vertical-mode, and then it will work as you expect. Like
this:
(defun icvsetup ()
(interactive)
(setq-local icomplete-hide-common-prefix nil
icomplete-prospects-height 25
redisplay-adhoc-scroll-in-resize-mini-windows nil)
(icomplete-vertical-mode))
(progn
(with-eval-after-load 'icomplete
(define-key icomplete-minibuffer-map (kbd "C-v") #'icvsetup)
(customize-set-variable 'icomplete-show-matches-on-no-input t))
(icomplete-mode))
IOW, this is a cockpit error, not a bug in Emacs.
This bug report was last modified 2 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.