aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-28 18:35:23 +0000
committerRichard M. Stallman1993-05-28 18:35:23 +0000
commitf4008b6ee93cd08138156009ef0c91d4f107776d (patch)
tree1844ac0eb49495e9633c678999780c0b86da61d7
parente562af697cf6a8a3eeceed3b27ebdb0591656476 (diff)
downloademacs-f4008b6ee93cd08138156009ef0c91d4f107776d.tar.gz
emacs-f4008b6ee93cd08138156009ef0c91d4f107776d.zip
(Info-insert-dir): Ignore duplicate directories.
-rw-r--r--lisp/info.el53
1 files changed, 28 insertions, 25 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 914e35fe267..e2079644102 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -287,36 +287,39 @@ to read a file name from the minibuffer."
287 (if Info-dir-contents 287 (if Info-dir-contents
288 (insert Info-dir-contents) 288 (insert Info-dir-contents)
289 (let ((dirs Info-directory-list) 289 (let ((dirs Info-directory-list)
290 buffers buffer others nodes) 290 buffers buffer others nodes dirs-done)
291 291
292 ;; Search the directory list for the directory file. 292 ;; Search the directory list for the directory file.
293 (while dirs 293 (while dirs
294 ;; Try several variants of specified name. 294 (or (member (file-truename (expand-file-name (car dirs))) dirs-done)
295 ;; Try upcasing, appending `.info', or both. 295 (member (directory-file-name (file-truename (expand-file-name (car dirs))))
296 (let* (temp 296 dirs-done)
297 (buffer 297 ;; Try several variants of specified name.
298 (cond 298 ;; Try upcasing, appending `.info', or both.
299 ((progn (setq temp (expand-file-name "DIR" (car dirs))) 299 (let* (temp
300 (file-exists-p temp)) 300 (buffer
301 (find-file-noselect temp)) 301 (cond
302 ((progn (setq temp (expand-file-name "dir" (car dirs))) 302 ((progn (setq temp (expand-file-name "DIR" (car dirs)))
303 (file-exists-p temp)) 303 (file-exists-p temp))
304 (find-file-noselect temp)) 304 (find-file-noselect temp))
305 ((progn (setq temp (expand-file-name "DIR.INFO" (car dirs))) 305 ((progn (setq temp (expand-file-name "dir" (car dirs)))
306 (file-exists-p temp)) 306 (file-exists-p temp))
307 (find-file-noselect temp)) 307 (find-file-noselect temp))
308 ((progn (setq temp (expand-file-name "dir.info" (car dirs))) 308 ((progn (setq temp (expand-file-name "DIR.INFO" (car dirs)))
309 (file-exists-p temp)) 309 (file-exists-p temp))
310 (find-file-noselect temp))))) 310 (find-file-noselect temp))
311 (if buffer (setq buffers (cons buffer buffers))) 311 ((progn (setq temp (expand-file-name "dir.info" (car dirs)))
312 (setq dirs (cdr dirs)))) 312 (file-exists-p temp))
313 (find-file-noselect temp)))))
314 (setq dirs-done
315 (cons (file-truename (expand-file-name (car dirs)))
316 dirs-done))
317 (if buffer (setq buffers (cons buffer buffers)))))
318 (setq dirs (cdr dirs)))
313 319
314 ;; Distinguish the dir file that comes with Emacs from all the 320 ;; Distinguish the dir file that comes with Emacs from all the
315 ;; others. [This sounds like baloney - who knows what order 321 ;; others. Yes, that is really what this is supposed to do.
316 ;; Info-directory-list is in, especially after checking the 322 ;; If it doesn't work, fix it.
317 ;; INFOPATH variable, and why should Emacs's dir be special? If
318 ;; you understand what this comment should have said, please
319 ;; change it.]
320 (setq buffer (car buffers) 323 (setq buffer (car buffers)
321 others (cdr buffers)) 324 others (cdr buffers))
322 325