Mercurial > emacs
comparison lisp/finder.el @ 21758:bc7f520d8251
(finder-compile-keywords):
Avoid error for nonexistent directory.
Print progress messages about directories.
Ignore files that are actually Emacs lock files.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 24 Apr 1998 21:24:44 +0000 |
parents | 3b9b07f3eab5 |
children | aafa93c1a5ce |
comparison
equal
deleted
inserted
replaced
21757:629f6df4a329 | 21758:bc7f520d8251 |
---|---|
114 (insert ";; Don't edit this file. It's generated by finder.el\n\n") | 114 (insert ";; Don't edit this file. It's generated by finder.el\n\n") |
115 (insert ";;; Code:\n") | 115 (insert ";;; Code:\n") |
116 (insert "\n(setq finder-package-info '(\n") | 116 (insert "\n(setq finder-package-info '(\n") |
117 (mapcar | 117 (mapcar |
118 (lambda (d) | 118 (lambda (d) |
119 (mapcar | 119 (when (file-exists-p (directory-file-name d)) |
120 (lambda (f) | 120 (message "Directory %s" d) |
121 (if (and (or (string-match "^[^=].*\\.el$" f) | 121 (mapcar |
122 ;; Allow compressed files also. Fixme: | 122 (lambda (f) |
123 ;; generalize this, especially for | 123 (if (and (or (string-match "^[^=].*\\.el$" f) |
124 ;; MS-DOG-type filenames. | 124 ;; Allow compressed files also. Fixme: |
125 (and (string-match "^[^=].*\\.el\\.\\(gz\\|Z\\)$" f) | 125 ;; generalize this, especially for |
126 (require 'jka-compr))) | 126 ;; MS-DOG-type filenames. |
127 (not (member f processed))) | 127 (and (string-match "^[^=].*\\.el\\.\\(gz\\|Z\\)$" f) |
128 (let (summary keystart keywords) | 128 (require 'jka-compr))) |
129 (setq processed (cons f processed)) | 129 ;; Ignore lock files. |
130 (save-excursion | 130 (not (string-match "^.#" f)) |
131 (set-buffer (get-buffer-create "*finder-scratch*")) | 131 (not (member f processed))) |
132 (buffer-disable-undo (current-buffer)) | 132 (let (summary keystart keywords) |
133 (erase-buffer) | 133 (setq processed (cons f processed)) |
134 (insert-file-contents | 134 (save-excursion |
135 (concat (file-name-as-directory (or d ".")) f)) | 135 (set-buffer (get-buffer-create "*finder-scratch*")) |
136 (setq summary (lm-synopsis)) | 136 (buffer-disable-undo (current-buffer)) |
137 (setq keywords (lm-keywords))) | 137 (erase-buffer) |
138 (insert | 138 (insert-file-contents |
139 (format " (\"%s\"\n " | 139 (concat (file-name-as-directory (or d ".")) f)) |
140 (if (string-match "\\.\\(gz\\|Z\\)$" f) | 140 (setq summary (lm-synopsis)) |
141 (file-name-sans-extension f) | 141 (setq keywords (lm-keywords))) |
142 f))) | 142 (insert |
143 (prin1 summary (current-buffer)) | 143 (format " (\"%s\"\n " |
144 (insert | 144 (if (string-match "\\.\\(gz\\|Z\\)$" f) |
145 "\n ") | 145 (file-name-sans-extension f) |
146 (setq keystart (point)) | 146 f))) |
147 (insert | 147 (prin1 summary (current-buffer)) |
148 (if keywords (format "(%s)" keywords) "nil") | 148 (insert |
149 ")\n") | 149 "\n ") |
150 (subst-char-in-region keystart (point) ?, ? ) | 150 (setq keystart (point)) |
151 ))) | 151 (insert |
152 (directory-files (or d ".")))) | 152 (if keywords (format "(%s)" keywords) "nil") |
153 ")\n") | |
154 (subst-char-in-region keystart (point) ?, ? ) | |
155 ))) | |
156 (directory-files (or d "."))))) | |
153 (or dirs load-path)) | 157 (or dirs load-path)) |
154 (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n") | 158 (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n") |
155 (kill-buffer "*finder-scratch*") | 159 (kill-buffer "*finder-scratch*") |
156 (eval-current-buffer) ;; So we get the new keyword list immediately | 160 (eval-current-buffer) ;; So we get the new keyword list immediately |
157 (basic-save-buffer)))) | 161 (basic-save-buffer)))) |