aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-15 18:13:52 +0000
committerRichard M. Stallman1994-06-15 18:13:52 +0000
commit825d6f08db6a8ea5cc28bf5f99c19883cb5529af (patch)
treef48d0c25271137bae03f8bd25e8e4ee7b13d9ad4
parent8f6c93e2bb3236358f842fb6befca5bf25b9b430 (diff)
downloademacs-825d6f08db6a8ea5cc28bf5f99c19883cb5529af.tar.gz
emacs-825d6f08db6a8ea5cc28bf5f99c19883cb5529af.zip
(Info-insert-dir): Ignore access times when comparing
file attributes. Print message while merging. Use separate buffers for merging. Try lower case `dir' first.
-rw-r--r--lisp/info.el57
1 files changed, 32 insertions, 25 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 4519a22d314..fc20c4b61e7 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -347,13 +347,18 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
347 ;; since we used it. 347 ;; since we used it.
348 (eval (cons 'and 348 (eval (cons 'and
349 (mapcar '(lambda (elt) 349 (mapcar '(lambda (elt)
350 (equal (cdr elt) 350 (let ((curr (file-attributes (car elt))))
351 (file-attributes (car elt)))) 351 ;; Don't compare the access time.
352 (if curr (setcar (nthcdr 4 curr) 0))
353 (setcar (nthcdr 4 (cdr elt)) 0)
354 (equal (cdr elt) curr)))
352 Info-dir-file-attributes)))) 355 Info-dir-file-attributes))))
353 (insert Info-dir-contents) 356 (insert Info-dir-contents)
354 (let ((dirs Info-directory-list) 357 (let ((dirs Info-directory-list)
355 buffers buffer others nodes dirs-done) 358 buffers buffer others nodes dirs-done)
356 359
360 (setq Info-dir-file-attributes nil)
361
357 ;; Search the directory list for the directory file. 362 ;; Search the directory list for the directory file.
358 (while dirs 363 (while dirs
359 (let ((truename (file-truename (expand-file-name (car dirs))))) 364 (let ((truename (file-truename (expand-file-name (car dirs)))))
@@ -361,32 +366,33 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
361 (member (directory-file-name truename) dirs-done) 366 (member (directory-file-name truename) dirs-done)
362 ;; Try several variants of specified name. 367 ;; Try several variants of specified name.
363 ;; Try upcasing, appending `.info', or both. 368 ;; Try upcasing, appending `.info', or both.
364 (let* (temp 369 (let* (file
365 (buffer 370 (attrs
366 (cond 371 (or
367 ((progn (setq temp (expand-file-name "DIR" (car dirs))) 372 (progn (setq file (expand-file-name "dir" truename))
368 (file-exists-p temp)) 373 (file-attributes file))
369 (find-file-noselect temp)) 374 (progn (setq file (expand-file-name "DIR" truename))
370 ((progn (setq temp (expand-file-name "dir" (car dirs))) 375 (file-attributes file))
371 (file-exists-p temp)) 376 (progn (setq file (expand-file-name "dir.info" truename))
372 (find-file-noselect temp)) 377 (file-attributes file))
373 ((progn (setq temp (expand-file-name "DIR.INFO" (car dirs))) 378 (progn (setq file (expand-file-name "DIR.INFO" truename))
374 (file-exists-p temp)) 379 (file-attributes file)))))
375 (find-file-noselect temp))
376 ((progn (setq temp (expand-file-name "dir.info" (car dirs)))
377 (file-exists-p temp))
378 (find-file-noselect temp)))))
379 (setq dirs-done 380 (setq dirs-done
380 (cons truename 381 (cons truename
381 (cons (directory-file-name truename) 382 (cons (directory-file-name truename)
382 dirs-done))) 383 dirs-done)))
383 (if buffer (setq buffers (cons buffer buffers) 384 (if attrs
384 Info-dir-file-attributes 385 (save-excursion
385 (cons (cons (buffer-file-name buffer) 386 (or buffers
386 (file-attributes (buffer-file-name buffer))) 387 (message "Composing main Info directory..."))
387 Info-dir-file-attributes)))))) 388 (set-buffer (generate-new-buffer "info dir"))
388 (setq dirs (cdr dirs))) 389 (insert-file-contents file)
389 390 (setq buffers (cons (current-buffer) buffers)
391 Info-dir-file-attributes
392 (cons (cons file attrs)
393 Info-dir-file-attributes))))))
394 (setq dirs (cdr dirs))))
395
390 (or buffers 396 (or buffers
391 (error "Can't find the info directory node")) 397 (error "Can't find the info directory node"))
392 ;; Distinguish the dir file that comes with Emacs from all the 398 ;; 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."
466 ;; Kill all the buffers we just made. 472 ;; Kill all the buffers we just made.
467 (while buffers 473 (while buffers
468 (kill-buffer (car buffers)) 474 (kill-buffer (car buffers))
469 (setq buffers (cdr buffers)))) 475 (setq buffers (cdr buffers)))
476 (message "Composing main Info directory...done"))
470 (setq Info-dir-contents (buffer-string))) 477 (setq Info-dir-contents (buffer-string)))
471 (setq default-directory Info-dir-contents-directory)) 478 (setq default-directory Info-dir-contents-directory))
472 479