Function: lm-synopsis

lm-synopsis is an interactive and byte-compiled function defined in lisp-mnt.el.gz.

Signature

(lm-synopsis &optional FILE SHOWALL)

Documentation

Generate a synopsis listing for the buffer or the given FILE if given.

If FILE is a directory, recurse on its files and generate a report in a temporary buffer. If SHOWALL is non-nil, also generate a line for files which do not include a recognizable synopsis.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/lisp-mnt.el.gz
(defun lm-synopsis (&optional file showall)
  "Generate a synopsis listing for the buffer or the given FILE if given.
If FILE is a directory, recurse on its files and generate a report in
a temporary buffer.  If SHOWALL is non-nil, also generate a line for files
which do not include a recognizable synopsis."
  (interactive
   (list
    (read-file-name "Synopsis for (file or dir): ")))

  (if (and file (file-directory-p file))
      (with-output-to-temp-buffer "*Synopsis*"
        (set-buffer standard-output)
        (dolist (f (directory-files file nil ".*\\.el\\'"))
          (let ((syn (lm-synopsis (expand-file-name f file))))
            (when (or syn showall)
              (insert f ":")
              (lm-insert-at-column lm-comment-column (or syn "NA") "\n")))))
    (save-excursion
      (let ((must-kill (and file (not (get-file-buffer file)))))
        (when file (find-file file))
        (prog1
            (if (called-interactively-p 'interactive)
                (message "%s" (lm-summary))
              (lm-summary))
          (when must-kill (kill-buffer (current-buffer))))))))