Function: describe-function-1

describe-function-1 is an autoloaded and byte-compiled function defined in help-fns.el.gz.

Signature

(describe-function-1 FUNCTION)

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
;;;###autoload
(defun describe-function-1 (function)
  (let ((pt1 (with-current-buffer standard-output (point))))
    (help-fns-function-description-header function)
    (with-current-buffer standard-output
      (let ((inhibit-read-only t))
        (fill-region-as-paragraph
         (save-excursion
           (goto-char pt1)
           (forward-line 0)
           (point))
         (point)
         nil t)
        (ensure-empty-lines))))

  (help-fns--obsolete function)

  (pcase-let* ((`(,real-function ,def ,_aliased ,real-def)
                (help-fns--analyze-function function))
               (doc-raw (condition-case nil
                            ;; FIXME: Maybe `documentation' should return nil
                            ;; for invalid functions i.s.o. signaling an error.
                            (documentation function t)
                          ;; E.g. an alias for a not yet defined function.
                          ((invalid-function void-function) nil))))

    ;; If the function is autoloaded, and its docstring has
    ;; key substitution constructs, load the library.
    (and (autoloadp real-def) doc-raw
         help-enable-autoload
         (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]\\|`.*'" doc-raw)
         (autoload-do-load real-def))

    (help-fns--key-bindings function)
    (with-current-buffer standard-output
      (let ((doc (condition-case nil
                     ;; FIXME: Maybe `help-fns--signature' should return `doc'
                     ;; for invalid functions i.s.o. signaling an error.
                     (help-fns--signature
                      function doc-raw
                      (if (subrp def) (indirect-function real-def) real-def)
                      real-function describe-function-orig-buffer)
                   ;; E.g. an alias for a not yet defined function.
                   ((invalid-function void-function) doc-raw))))
        (help-fns--ensure-empty-line)
        (insert (or doc "Not documented."))
        (help-fns--run-describe-functions
         help-fns-describe-function-functions function))
      ;; Avoid asking the user annoying questions if she decides
      ;; to save the help buffer, when her locale's codeset
      ;; isn't UTF-8.
      (unless (memq text-quoting-style '(straight grave))
        (set-buffer-file-coding-system 'utf-8)))))