changeset 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 629f6df4a329
children 53f1e474e639
files lisp/finder.el
diffstat 1 files changed, 38 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/finder.el	Fri Apr 24 21:22:48 1998 +0000
+++ b/lisp/finder.el	Fri Apr 24 21:24:44 1998 +0000
@@ -116,40 +116,44 @@
       (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*")