Function: corfu-info-documentation

corfu-info-documentation is an autoloaded, interactive and byte-compiled function defined in corfu-info.el.

Signature

(corfu-info-documentation &optional ARG)

Documentation

Show documentation of current candidate.

If called with a prefix ARG, the buffer is persistent.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/corfu-20260813.950/corfu-info.el
;;;###autoload
(defun corfu-info-documentation (&optional arg)
  "Show documentation of current candidate.
If called with a prefix ARG, the buffer is persistent."
  (interactive "P")
  ;; Company support, taken from `company.el', see `company-show-doc-buffer'.
  (when (< corfu--index 0)
    (user-error "No candidate selected"))
  (cl-letf* ((cand (nth corfu--index corfu--candidates))
             (cand-str (substring-no-properties cand))
             ((symbol-function #'help-buffer) ;; Work around bug#79792
              (lambda () (get-buffer-create " *corfu-info*"))))
    (if-let* ((fun (corfu--metadata-get 'company-doc-buffer))
              (res (funcall fun cand)))
        (set-window-start (corfu-info--display-buffer
                           (get-buffer (or (car-safe res) res))
                           (and arg (format "*corfu info: %s*" cand-str)))
                          (or (cdr-safe res) (point-min)))
      (user-error "No documentation available for `%s'" cand-str))))