Function: elisp--docstring-first-line

elisp--docstring-first-line is a byte-compiled function defined in elisp-mode.el.gz.

Signature

(elisp--docstring-first-line DOC)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
;; Note that any leading `*' in the docstring (which indicates the variable
;; is a user option) is removed.
(defun elisp--docstring-first-line (doc)
  (and (stringp doc)
       (substitute-command-keys
        (save-match-data
	  ;; Don't use "^" in the regexp below since it may match
	  ;; anywhere in the doc-string.
	  (let ((start (if (string-match "\\`\\*" doc) (match-end 0) 0)))
            (cond ((string-match "\n" doc)
                   (substring doc start (match-beginning 0)))
                  ((zerop start) doc)
                  (t (substring doc start))))))))