summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-12-05 19:53:00 +0000
committerKarl Heuer <kwzh@gnu.org>1996-12-05 19:53:00 +0000
commit77e88396649f5f495def880d1a55f85c8c30cda9 (patch)
treebf1d747a6c5be5fb1fa7997ecd134a052e9aef7d /lisp/info.el
parent392c2ab158ef1ae30156081afae0e4f36d5351bf (diff)
downloademacs-77e88396649f5f495def880d1a55f85c8c30cda9.tar.gz
(Info-follow-reference): Add each cross-reference to
completions list just once, case-insensitively.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 9e001469073..c3df1a843be 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -894,9 +894,18 @@ NAME may be an abbreviation of the reference name."
;; 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))