]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-insert-dir): Ignore access times when comparing
authorRichard M. Stallman <rms@gnu.org>
Wed, 15 Jun 1994 18:13:52 +0000 (18:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 15 Jun 1994 18:13:52 +0000 (18:13 +0000)
file attributes.  Print message while merging.  Use separate
buffers for merging.  Try lower case `dir' first.

lisp/info.el

index 4519a22d3143c6bfd11dbe5708a3659416983c05..fc20c4b61e7264eef7a9d550770db52083e2f1a2 100644 (file)
@@ -347,13 +347,18 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
           ;; 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 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
              (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 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
       ;; 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))