diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-04-24 21:24:44 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-04-24 21:24:44 +0000 |
commit | 5b64ebe8ec5b475e5e8685cf5d3f488c57a844e8 (patch) | |
tree | da7b51e353d13d8bc99ad803a688c9be61a77462 /lisp/finder.el | |
parent | 6395da5cede0b4977b4a9a61e5735bf78c1f313d (diff) | |
download | emacs-5b64ebe8ec5b475e5e8685cf5d3f488c57a844e8.tar.gz |
(finder-compile-keywords):
Avoid error for nonexistent directory.
Print progress messages about directories.
Ignore files that are actually Emacs lock files.
Diffstat (limited to 'lisp/finder.el')
-rw-r--r-- | lisp/finder.el | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/lisp/finder.el b/lisp/finder.el index 3d8bb281fe7..652f29cc9d1 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -116,40 +116,44 @@ arguments compiles from `load-path'." (insert "\n(setq finder-package-info '(\n") (mapcar (lambda (d) - (mapcar - (lambda (f) - (if (and (or (string-match "^[^=].*\\.el$" f) - ;; Allow compressed files also. Fixme: - ;; generalize this, especially for - ;; MS-DOG-type filenames. - (and (string-match "^[^=].*\\.el\\.\\(gz\\|Z\\)$" f) - (require 'jka-compr))) - (not (member f processed))) - (let (summary keystart keywords) - (setq processed (cons f processed)) - (save-excursion - (set-buffer (get-buffer-create "*finder-scratch*")) - (buffer-disable-undo (current-buffer)) - (erase-buffer) - (insert-file-contents - (concat (file-name-as-directory (or d ".")) f)) - (setq summary (lm-synopsis)) - (setq keywords (lm-keywords))) - (insert - (format " (\"%s\"\n " - (if (string-match "\\.\\(gz\\|Z\\)$" f) - (file-name-sans-extension f) - f))) - (prin1 summary (current-buffer)) - (insert - "\n ") - (setq keystart (point)) - (insert - (if keywords (format "(%s)" keywords) "nil") - ")\n") - (subst-char-in-region keystart (point) ?, ? ) - ))) - (directory-files (or d ".")))) + (when (file-exists-p (directory-file-name d)) + (message "Directory %s" d) + (mapcar + (lambda (f) + (if (and (or (string-match "^[^=].*\\.el$" f) + ;; Allow compressed files also. Fixme: + ;; generalize this, especially for + ;; MS-DOG-type filenames. + (and (string-match "^[^=].*\\.el\\.\\(gz\\|Z\\)$" f) + (require 'jka-compr))) + ;; Ignore lock files. + (not (string-match "^.#" f)) + (not (member f processed))) + (let (summary keystart keywords) + (setq processed (cons f processed)) + (save-excursion + (set-buffer (get-buffer-create "*finder-scratch*")) + (buffer-disable-undo (current-buffer)) + (erase-buffer) + (insert-file-contents + (concat (file-name-as-directory (or d ".")) f)) + (setq summary (lm-synopsis)) + (setq keywords (lm-keywords))) + (insert + (format " (\"%s\"\n " + (if (string-match "\\.\\(gz\\|Z\\)$" f) + (file-name-sans-extension f) + f))) + (prin1 summary (current-buffer)) + (insert + "\n ") + (setq keystart (point)) + (insert + (if keywords (format "(%s)" keywords) "nil") + ")\n") + (subst-char-in-region keystart (point) ?, ? ) + ))) + (directory-files (or d "."))))) (or dirs load-path)) (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n") (kill-buffer "*finder-scratch*") |