comparison lisp/info.el @ 16609:21c4e4e580a9

(Info-follow-reference): Add each cross-reference to completions list just once, case-insensitively.
author Karl Heuer <kwzh@gnu.org>
date Thu, 05 Dec 1996 19:53:00 +0000
parents a0cfcb9f8033
children ee85ec2c4203
comparison
equal deleted inserted replaced
16608:e2858bcbed43 16609:21c4e4e580a9
892 (substring str (match-end 0)))) 892 (substring str (match-end 0))))
893 (setq i (1+ i))) 893 (setq i (1+ i)))
894 ;; Record as a completion and perhaps as default. 894 ;; Record as a completion and perhaps as default.
895 (if (eq default t) (setq default str)) 895 (if (eq default t) (setq default str))
896 (if (eq alt-default t) (setq alt-default str)) 896 (if (eq alt-default t) (setq alt-default str))
897 (setq completions 897 ;; Don't add this string if it's a duplicate.
898 (cons (cons str nil) 898 ;; We use a loop instead of "(assoc str completions)" because
899 completions)))) 899 ;; we want to do a case-insensitive compare.
900 (let ((tail completions)
901 (tem (downcase str)))
902 (while (and tail
903 (not (string-equal tem (downcase (car (car tail))))))
904 (setq tail (cdr tail)))
905 (or tail
906 (setq completions
907 (cons (cons str nil)
908 completions))))))
900 ;; If no good default was found, try an alternate. 909 ;; If no good default was found, try an alternate.
901 (or default 910 (or default
902 (setq default alt-default)) 911 (setq default alt-default))
903 ;; If only one cross-reference found, then make it default. 912 ;; If only one cross-reference found, then make it default.
904 (if (eq (length completions) 1) 913 (if (eq (length completions) 1)