Function: minibuffer--completions-visible

minibuffer--completions-visible is a byte-compiled function defined in minibuffer.el.gz.

Signature

(minibuffer--completions-visible)

Documentation

Return the window where the current *Completions* buffer is visible, if any.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun minibuffer--completions-visible ()
  "Return the window where the current *Completions* buffer is visible, if any."
  (when-let* ((window (get-buffer-window "*Completions*" 'visible)))
    (let ((reference-buffer
           (buffer-local-value 'completion-reference-buffer
                               (window-buffer window))))
      (when (or (null reference-buffer)
                (eq reference-buffer
                    ;; If there's no active minibuffer, we call
                    ;; `window-buffer' on nil, assuming that completion is
                    ;; happening in the selected window.
                    (window-buffer (active-minibuffer-window))))
        window))))