diff 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
line wrap: on
line diff
--- a/lisp/finder.el	Mon Aug 13 11:06:08 2007 +0200
+++ b/lisp/finder.el	Mon Aug 13 11:07:10 2007 +0200
@@ -162,47 +162,44 @@
       (insert ";;; Commentary:\n")
       (insert ";; Don't edit this file.  It's generated by finder.el\n\n")
       (insert ";;; Code:\n")
-      (insert "\n(setq finder-package-info '(\n")
+      (insert "\n(defconst finder-package-info '(\n")
       (mapcar
-       (function
-	(lambda (d)
-	  (mapcar
-	   (function
-	    (lambda (f) 
-	      (if (not (member f processed))
-		  (let (summary keystart keywords)
-		    (setq processed (cons f processed))
-		    (if (not finder-compile-keywords-quiet)
-			(message "Processing %s ..." f))
-		    (save-excursion
-		      (set-buffer (get-buffer-create "*finder-scratch*"))
-		      (buffer-disable-undo (current-buffer))
-		      (erase-buffer)
-		      (insert-file-contents (expand-file-name f d))
-		      (condition-case err
-			  (setq summary  (lm-synopsis)
-				keywords (lm-keywords))
-			(t (message "finder: error processing %s %S" f err))))
-		    (if (not summary)
-			nil
-		      (insert (format "    (\"%s\"\n        " f))
-		      (prin1 summary (current-buffer))
-		      (insert "\n        ")
-		      (setq keystart (point))
-		      (insert (if keywords (format "(%s)" keywords) "nil"))
-		      (subst-char-in-region keystart (point) ?, ? )
-		      (insert "\n        ")
-		      (prin1 (abbreviate-file-name d) (current-buffer))
-		      (insert ")\n"))))))
-	   ;;
-	   ;; Skip null, non-existent or relative pathnames, e.g. "./", if
-	   ;; using load-path, so that they do not interfere with a scan of
-	   ;; library directories only.
-	   (if (and using-load-path
-		    (not (and d (file-name-absolute-p d) (file-exists-p d))))
-	       nil
-	     (setq d (file-name-as-directory (or d ".")))
-	     (directory-files d nil "^[^=].*\\.el$")))))
+       (lambda (d)
+	 (mapcar
+	  (lambda (f) 
+	    (when (not (member f processed))
+	      (let (summary keystart keywords)
+		(setq processed (cons f processed))
+		(if (not finder-compile-keywords-quiet)
+		    (message "Processing %s ..." f))
+		(save-excursion
+		  (set-buffer (get-buffer-create "*finder-scratch*"))
+		  (buffer-disable-undo (current-buffer))
+		  (erase-buffer)
+		  (insert-file-contents (expand-file-name f d))
+		  (condition-case err
+		      (setq summary  (lm-synopsis)
+			    keywords (lm-keywords))
+		    (t (message "finder: error processing %s %S" f err))))
+		(when summary
+		  (insert (format "    (\"%s\"\n        " f))
+		  (prin1 summary (current-buffer))
+		  (insert "\n        ")
+		  (setq keystart (point))
+		  (insert (if keywords (format "(%s)" keywords) "nil"))
+		  (subst-char-in-region keystart (point) ?, ? )
+		  (insert "\n        ")
+		  (prin1 (abbreviate-file-name d) (current-buffer))
+		  (insert ")\n")))))
+	  ;;
+	  ;; Skip null, non-existent or relative pathnames, e.g. "./", if
+	  ;; using load-path, so that they do not interfere with a scan of
+	  ;; library directories only.
+	  (if (and using-load-path
+		   (not (and d (file-name-absolute-p d) (file-exists-p d))))
+	      nil
+	    (setq d (file-name-as-directory (or d ".")))
+	    (directory-files d nil "^[^=].*\\.el$"))))
        dirs)
       (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n")
       (kill-buffer "*finder-scratch*")