bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59486: completion-auto-wrap disobeyed by vertical navigation


From: Juri Linkov
Subject: bug#59486: completion-auto-wrap disobeyed by vertical navigation
Date: Sun, 05 Nov 2023 19:53:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> The argument zero to get-buffer-window AFAIU means that it will return
>> non-nil when the buffer is shown in some window on an iconified frame,
>> and I wonder why we would consider such a buffer "visible".
>
> (get-buffer-window "*Completions*" 0) is used everywhere in minibuffer.el
> and simple.el, so the argument zero is for compatibility with other
> minibuffer completion commands.

During testing I discovered that the condition should be more complex.
The problem is that the logic should be bound only to the minibuffer
that showed the completions, not in other minibuffers within a set of
recursive minibuffers.  An example: `M-x TAB C-h v down RET'
raised an error "Minibuffer is not active for completion".
This error comes from `choose-completion-string',
so I copied the same logic from `choose-completion-string':

  (when-let ((window (get-buffer-window "*Completions*" 0)))
    (when (eq (buffer-local-value 'completion-reference-buffer
                                  (window-buffer window))
              (window-buffer (active-minibuffer-window)))
      cmd))

>> Same here.
>
> Here is a new patch:

Now pushed the fixed patch.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]