aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/info.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-05-28 18:35:23 +0000
committerRichard M. Stallman <[email protected]>1993-05-28 18:35:23 +0000
commitf4008b6ee93cd08138156009ef0c91d4f107776d (patch)
tree1844ac0eb49495e9633c678999780c0b86da61d7 /lisp/info.el
parente562af697cf6a8a3eeceed3b27ebdb0591656476 (diff)
(Info-insert-dir): Ignore duplicate directories.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el53
1 files changed, 28 insertions, 25 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 914e35fe26..e207964410 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -287,36 +287,39 @@ to read a file name from the minibuffer."
(if Info-dir-contents
(insert Info-dir-contents)
(let ((dirs Info-directory-list)
- buffers buffer others nodes)
+ buffers buffer others nodes dirs-done)
;; Search the directory list for the directory file.
(while dirs
- ;; 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)))))
- (if buffer (setq buffers (cons buffer buffers)))
- (setq dirs (cdr dirs))))
+ (or (member (file-truename (expand-file-name (car dirs))) dirs-done)
+ (member (directory-file-name (file-truename (expand-file-name (car dirs))))
+ 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)))))
+ (setq dirs-done
+ (cons (file-truename (expand-file-name (car dirs)))
+ dirs-done))
+ (if buffer (setq buffers (cons buffer buffers)))))
+ (setq dirs (cdr dirs)))
;; Distinguish the dir file that comes with Emacs from all the
- ;; others. [This sounds like baloney - who knows what order
- ;; Info-directory-list is in, especially after checking the
- ;; INFOPATH variable, and why should Emacs's dir be special? If
- ;; you understand what this comment should have said, please
- ;; change it.]
+ ;; others. Yes, that is really what this is supposed to do.
+ ;; If it doesn't work, fix it.
(setq buffer (car buffers)
others (cdr buffers))