1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

(Info-insert-dir): Ignore access times when comparing

file attributes.  Print message while merging.  Use separate
buffers for merging.  Try lower case `dir' first.
This commit is contained in:
Richard M. Stallman 1994-06-15 18:13:52 +00:00
parent 8f6c93e2bb
commit 825d6f08db

View 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))