changeset 7911:185c1f12db67

(Info-insert-dir): Ignore access times when comparing file attributes. Print message while merging. Use separate buffers for merging. Try lower case `dir' first.
author Richard M. Stallman <rms@gnu.org>
date Wed, 15 Jun 1994 18:13:52 +0000
parents 842db6d87566
children f87185e63bbc
files lisp/info.el
diffstat 1 files changed, 32 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Wed Jun 15 18:05:50 1994 +0000
+++ b/lisp/info.el	Wed Jun 15 18:13:52 1994 +0000
@@ -347,13 +347,18 @@
 	   ;; since we used it.
 	   (eval (cons 'and
 		       (mapcar '(lambda (elt)
-				  (equal (cdr elt)
-					 (file-attributes (car elt))))
+				  (let ((curr (file-attributes (car elt))))
+				    ;; Don't compare the access time.
+				    (if curr (setcar (nthcdr 4 curr) 0))
+				    (setcar (nthcdr 4 (cdr elt)) 0)
+				    (equal (cdr elt) curr)))
 			       Info-dir-file-attributes))))
       (insert Info-dir-contents)
     (let ((dirs Info-directory-list)
 	  buffers buffer others nodes dirs-done)
 
+      (setq Info-dir-file-attributes nil)
+
       ;; Search the directory list for the directory file.
       (while dirs
 	(let ((truename (file-truename (expand-file-name (car dirs)))))
@@ -361,32 +366,33 @@
 	      (member (directory-file-name truename) dirs-done)
 	      ;; Try several variants of specified name.
 	      ;; Try upcasing, appending `.info', or both.
-	      (let* (temp
-		     (buffer
-		      (cond
-		       ((progn (setq temp (expand-file-name "DIR" (car dirs)))
-			       (file-exists-p temp))
-			(find-file-noselect temp))
-		       ((progn (setq temp (expand-file-name "dir" (car dirs)))
-			       (file-exists-p temp))
-			(find-file-noselect temp))
-		       ((progn (setq temp (expand-file-name "DIR.INFO" (car dirs)))
-			       (file-exists-p temp))
-			(find-file-noselect temp))
-		       ((progn (setq temp (expand-file-name "dir.info" (car dirs)))
-			       (file-exists-p temp))
-			(find-file-noselect temp)))))
+	      (let* (file
+		     (attrs
+		      (or
+		       (progn (setq file (expand-file-name "dir" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "DIR" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "dir.info" truename))
+			      (file-attributes file))
+		       (progn (setq file (expand-file-name "DIR.INFO" truename))
+			      (file-attributes file)))))
 		(setq dirs-done
 		      (cons truename
 			    (cons (directory-file-name truename)
 				  dirs-done)))
-		(if buffer (setq buffers (cons buffer buffers)
-				 Info-dir-file-attributes
-				 (cons (cons (buffer-file-name buffer)
-					     (file-attributes (buffer-file-name buffer)))
-				       Info-dir-file-attributes))))))
-	(setq dirs (cdr dirs)))
-
+		(if attrs
+		    (save-excursion
+		      (or buffers
+			  (message "Composing main Info directory..."))
+		      (set-buffer (generate-new-buffer "info dir"))
+		      (insert-file-contents file)
+		      (setq buffers (cons (current-buffer) buffers)
+			    Info-dir-file-attributes
+			    (cons (cons file attrs)
+				  Info-dir-file-attributes))))))
+	  (setq dirs (cdr dirs))))
+      
       (or buffers
 	  (error "Can't find the info directory node"))
       ;; Distinguish the dir file that comes with Emacs from all the
@@ -466,7 +472,8 @@
       ;; Kill all the buffers we just made.
       (while buffers
 	(kill-buffer (car buffers))
-	(setq buffers (cdr buffers))))
+	(setq buffers (cdr buffers)))
+      (message "Composing main Info directory...done"))
     (setq Info-dir-contents (buffer-string)))
   (setq default-directory Info-dir-contents-directory))