# HG changeset patch # User Karl Heuer # Date 849815580 0 # Node ID 21c4e4e580a96a94181dc0783a2018f4f24b7a01 # Parent e2858bcbed435ca389add18fdeebcc436052d899 (Info-follow-reference): Add each cross-reference to completions list just once, case-insensitively. diff -r e2858bcbed43 -r 21c4e4e580a9 lisp/info.el --- a/lisp/info.el Thu Dec 05 19:52:46 1996 +0000 +++ b/lisp/info.el Thu Dec 05 19:53:00 1996 +0000 @@ -894,9 +894,18 @@ ;; Record as a completion and perhaps as default. (if (eq default t) (setq default str)) (if (eq alt-default t) (setq alt-default str)) - (setq completions - (cons (cons str nil) - completions)))) + ;; Don't add this string if it's a duplicate. + ;; We use a loop instead of "(assoc str completions)" because + ;; we want to do a case-insensitive compare. + (let ((tail completions) + (tem (downcase str))) + (while (and tail + (not (string-equal tem (downcase (car (car tail)))))) + (setq tail (cdr tail))) + (or tail + (setq completions + (cons (cons str nil) + completions)))))) ;; If no good default was found, try an alternate. (or default (setq default alt-default))