comparison lisp/finder.el @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents c5d627a313b1
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
160 (insert ";;; finder-inf.el --- keyword-to-package mapping\n") 160 (insert ";;; finder-inf.el --- keyword-to-package mapping\n")
161 (insert ";; Keywords: help\n") 161 (insert ";; Keywords: help\n")
162 (insert ";;; Commentary:\n") 162 (insert ";;; Commentary:\n")
163 (insert ";; Don't edit this file. It's generated by finder.el\n\n") 163 (insert ";; Don't edit this file. It's generated by finder.el\n\n")
164 (insert ";;; Code:\n") 164 (insert ";;; Code:\n")
165 (insert "\n(setq finder-package-info '(\n") 165 (insert "\n(defconst finder-package-info '(\n")
166 (mapcar 166 (mapcar
167 (function 167 (lambda (d)
168 (lambda (d) 168 (mapcar
169 (mapcar 169 (lambda (f)
170 (function 170 (when (not (member f processed))
171 (lambda (f) 171 (let (summary keystart keywords)
172 (if (not (member f processed)) 172 (setq processed (cons f processed))
173 (let (summary keystart keywords) 173 (if (not finder-compile-keywords-quiet)
174 (setq processed (cons f processed)) 174 (message "Processing %s ..." f))
175 (if (not finder-compile-keywords-quiet) 175 (save-excursion
176 (message "Processing %s ..." f)) 176 (set-buffer (get-buffer-create "*finder-scratch*"))
177 (save-excursion 177 (buffer-disable-undo (current-buffer))
178 (set-buffer (get-buffer-create "*finder-scratch*")) 178 (erase-buffer)
179 (buffer-disable-undo (current-buffer)) 179 (insert-file-contents (expand-file-name f d))
180 (erase-buffer) 180 (condition-case err
181 (insert-file-contents (expand-file-name f d)) 181 (setq summary (lm-synopsis)
182 (condition-case err 182 keywords (lm-keywords))
183 (setq summary (lm-synopsis) 183 (t (message "finder: error processing %s %S" f err))))
184 keywords (lm-keywords)) 184 (when summary
185 (t (message "finder: error processing %s %S" f err)))) 185 (insert (format " (\"%s\"\n " f))
186 (if (not summary) 186 (prin1 summary (current-buffer))
187 nil 187 (insert "\n ")
188 (insert (format " (\"%s\"\n " f)) 188 (setq keystart (point))
189 (prin1 summary (current-buffer)) 189 (insert (if keywords (format "(%s)" keywords) "nil"))
190 (insert "\n ") 190 (subst-char-in-region keystart (point) ?, ? )
191 (setq keystart (point)) 191 (insert "\n ")
192 (insert (if keywords (format "(%s)" keywords) "nil")) 192 (prin1 (abbreviate-file-name d) (current-buffer))
193 (subst-char-in-region keystart (point) ?, ? ) 193 (insert ")\n")))))
194 (insert "\n ") 194 ;;
195 (prin1 (abbreviate-file-name d) (current-buffer)) 195 ;; Skip null, non-existent or relative pathnames, e.g. "./", if
196 (insert ")\n")))))) 196 ;; using load-path, so that they do not interfere with a scan of
197 ;; 197 ;; library directories only.
198 ;; Skip null, non-existent or relative pathnames, e.g. "./", if 198 (if (and using-load-path
199 ;; using load-path, so that they do not interfere with a scan of 199 (not (and d (file-name-absolute-p d) (file-exists-p d))))
200 ;; library directories only. 200 nil
201 (if (and using-load-path 201 (setq d (file-name-as-directory (or d ".")))
202 (not (and d (file-name-absolute-p d) (file-exists-p d)))) 202 (directory-files d nil "^[^=].*\\.el$"))))
203 nil
204 (setq d (file-name-as-directory (or d ".")))
205 (directory-files d nil "^[^=].*\\.el$")))))
206 dirs) 203 dirs)
207 (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n") 204 (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n")
208 (kill-buffer "*finder-scratch*") 205 (kill-buffer "*finder-scratch*")
209 (unless noninteractive 206 (unless noninteractive
210 (eval-current-buffer)) ; So we get the new keyword list immediately 207 (eval-current-buffer)) ; So we get the new keyword list immediately