Function: vertico-suspend

vertico-suspend is an autoloaded, interactive and byte-compiled function defined in vertico-suspend.el.

Signature

(vertico-suspend)

Documentation

Suspend the current completion session.

If the command is invoked from within the Vertico minibuffer, the current session is suspended. If the command is invoked from outside the minibuffer, the active minibuffer is either selected or the latest completion session is restored.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/vertico-20260913.1525/vertico-suspend.el
;;;###autoload
(defun vertico-suspend ()
  "Suspend the current completion session.
If the command is invoked from within the Vertico minibuffer, the
current session is suspended.  If the command is invoked from
outside the minibuffer, the active minibuffer is either selected
or the latest completion session is restored."
  (interactive)
  (declare-function vertico-buffer-mode "ext:vertico-buffer")
  (unless enable-recursive-minibuffers
    (user-error "Recursive minibuffers must be enabled"))
  (advice-add #'set-minibuffer-message :around #'vertico-suspend--message)
  (if-let* ((win (active-minibuffer-window))
            (buf (window-buffer win))
            ((buffer-local-value 'vertico--input buf)))
      (cond
       ((minibufferp)
        (add-hook 'pre-redisplay-functions #'vertico-suspend--unselect nil 'local)
        (setq vertico-suspend--ov (make-overlay (point-min) (point-max) nil t t))
        (overlay-put vertico-suspend--ov 'invisible t)
        (overlay-put vertico-suspend--ov 'priority 1000)
        (overlay-put vertico--candidates-ov 'before-string nil)
        (set-window-parameter win 'no-other-window t)
        (when (bound-and-true-p vertico-buffer-mode)
          (vertico-buffer-mode -1)
          (setq vertico-buffer--restore #'ignore))
        (vertico-suspend--unselect))
       (t
        (select-window win)
        (set-window-parameter win 'no-other-window nil)
        (remove-hook 'pre-redisplay-functions #'vertico-suspend--unselect 'local)
        (when vertico-suspend--ov
          (delete-overlay vertico-suspend--ov)
          (setq vertico-suspend--ov nil))
        (when (eq #'ignore (bound-and-true-p vertico-buffer--restore))
          (setq vertico-buffer--restore nil)
          (vertico-buffer-mode))))
    (user-error "No Vertico session to suspend or resume")))