aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-06-03 11:55:45 +0200
committerLars Ingebrigtsen2021-06-03 11:55:45 +0200
commit089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c (patch)
treea8441035992f63bc6a744c5f16f17d5e380d09cd
parent4bcc83c12461498c9b26a39895abebd8a002d629 (diff)
downloademacs-089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c.tar.gz
emacs-089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c.zip
Make the `i' command in Info-mode remove duplicate matches
* lisp/info.el (Info-index): Weed out duplicate matched (bug#3692).
-rw-r--r--lisp/info.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/info.el b/lisp/info.el
index cdf339ff6fb..83a9bfbc235 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3375,7 +3375,13 @@ Give an empty topic name to go to the Index node itself."
3375 (setq exact (cons found exact) 3375 (setq exact (cons found exact)
3376 matches (delq found matches))) 3376 matches (delq found matches)))
3377 (setq Info-history-list ohist-list) 3377 (setq Info-history-list ohist-list)
3378 (setq Info-index-alternatives (nconc exact (nreverse matches))) 3378 (setq Info-index-alternatives
3379 ;; Weed out index entries that refer to the same line.
3380 (seq-uniq
3381 (nconc exact (nreverse matches))
3382 (lambda (m1 m2)
3383 (and (equal (nth 1 m1) (nth 1 m2))
3384 (equal (nth 3 m1) (nth 3 m2))))))
3379 (Info-index-next 0))))) 3385 (Info-index-next 0)))))
3380 3386
3381(defun Info-index-next (num) 3387(defun Info-index-next (num)