summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mnt.el
diff options
context:
space:
mode:
authorLute Kamstra <lute@gnu.org>2003-06-02 10:23:19 +0000
committerLute Kamstra <lute@gnu.org>2003-06-02 10:23:19 +0000
commitccb78fa385044cdb3ac9d296b7abca0c72a55d0a (patch)
treeb372528ad0a8973e7160adda2e7d0dc61a199c8b /lisp/emacs-lisp/lisp-mnt.el
parent8d1203eafba0177bc1f8401f01f52716fa2afbc9 (diff)
downloademacs-ccb78fa385044cdb3ac9d296b7abca0c72a55d0a.tar.gz
emacs-ccb78fa385044cdb3ac9d296b7abca0c72a55d0a.tar.bz2
emacs-ccb78fa385044cdb3ac9d296b7abca0c72a55d0a.zip
(lm-synopsis): Use relative filenames correctly. Show the synopsis to
the user when appropriate. Do not kill buffers that were created outside `lm-synopsis'.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mnt.el')
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el33
1 files changed, 14 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index dfa12f970f7..d282f452456 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -566,26 +566,21 @@ which do not include a recognizable synopsis."
(read-file-name "Synopsis for (file or dir): ")))
(if (and file (file-directory-p file))
- (with-temp-buffer
- (mapcar
- (lambda (f)
- (if (string-match "\\.el\\'" f)
- (let ((syn (lm-synopsis f)))
- (if syn
- (progn
- (insert f ":")
- (lm-insert-at-column lm-comment-column syn "\n"))
- (when showall
- (insert f ":")
- (lm-insert-at-column lm-comment-column "NA\n"))))))
- (directory-files 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
- (if file
- (find-file file))
- (prog1
- (lm-summary)
- (if file
- (kill-buffer (current-buffer)))))))
+ (let ((must-kill (and file (not (get-file-buffer file)))))
+ (when file (find-file file))
+ (prog1
+ (if (interactive-p)
+ (message "%s" (lm-summary))
+ (lm-summary))
+ (when must-kill (kill-buffer (current-buffer))))))))
(eval-when-compile (defvar report-emacs-bug-address))