Function: lm-commentary
lm-commentary is a byte-compiled function defined in lisp-mnt.el.gz.
Signature
(lm-commentary &optional FILE)
Documentation
Return the commentary in file FILE, or current buffer if FILE is nil.
Return the value as a string. In the file, the commentary
section starts with the tag Commentary or Documentation and
ends just before the next section. If the commentary section is
absent, return nil.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/lisp-mnt.el.gz
(defun lm-commentary (&optional file)
"Return the commentary in file FILE, or current buffer if FILE is nil.
Return the value as a string. In the file, the commentary
section starts with the tag `Commentary' or `Documentation' and
ends just before the next section. If the commentary section is
absent, return nil."
(lm-with-file file
(let ((start (lm-commentary-start)))
(when start
(replace-regexp-in-string ; Get rid of...
"[[:blank:]]*$" "" ; trailing white-space
(replace-regexp-in-string
(format "%s\\|%s\\|%s"
;; commentary header
(concat "^;;;[[:blank:]]*\\("
lm-commentary-header
"\\):[[:blank:]\n]*")
"^;;[[:blank:]]?" ; double semicolon prefix
"[[:blank:]\n]*\\'") ; trailing new-lines
"" (buffer-substring-no-properties
start (lm-commentary-end))))))))