# HG changeset patch # User Richard M. Stallman # Date 771704032 0 # Node ID 185c1f12db6762f632ce9d45144845ccf5882f3a # Parent 842db6d8756672487af4051c43ca71daf47ec485 (Info-insert-dir): Ignore access times when comparing file attributes. Print message while merging. Use separate buffers for merging. Try lower case `dir' first. diff -r 842db6d87566 -r 185c1f12db67 lisp/info.el --- 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))