Function: cl-describe-type

cl-describe-type is an autoloaded, interactive and byte-compiled function defined in cl-extra.el.gz.

Signature

(cl-describe-type TYPE &optional BUF FRAME)

Documentation

Display the documentation for type TYPE (a symbol).

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-extra.el.gz
;;;###autoload
(defun cl-describe-type (type &optional _buf _frame)
  "Display the documentation for type TYPE (a symbol)."
  (interactive
   (let ((str (completing-read "Describe type: " obarray #'cl-find-class t)))
     (if (<= (length str) 0)
         (user-error "Abort!")
       (list (intern str)))))
  (help-setup-xref (list #'cl-describe-type type)
                   (called-interactively-p 'interactive))
  (save-excursion
    (with-help-window (help-buffer)
      (with-current-buffer standard-output
        (let ((class (cl-find-class type)))
          (if class
              (cl--describe-class type class)
            ;; FIXME: Describe other types (the built-in ones, or those from
            ;; cl-deftype).
            (user-error "Unknown type %S" type))))
      (with-current-buffer standard-output
        (help-fns--setup-xref-backend)
        ;; Return the text we displayed.
        (buffer-string)))))