emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 089e0c4: Make the `i' command in Info-mode remove duplicate match


From: Lars Ingebrigtsen
Subject: master 089e0c4: Make the `i' command in Info-mode remove duplicate matches
Date: Thu, 3 Jun 2021 05:55:52 -0400 (EDT)

branch: master
commit 089e0c4c55dcf72f9cf2f6f04b8a52fc7355499c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make the `i' command in Info-mode remove duplicate matches
    
    * lisp/info.el (Info-index): Weed out duplicate matched
    (bug#3692).
---
 lisp/info.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/info.el b/lisp/info.el
index cdf339f..83a9bfb 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."
            (setq exact (cons found exact)
                  matches (delq found matches)))
           (setq Info-history-list ohist-list)
-         (setq Info-index-alternatives (nconc exact (nreverse matches)))
+         (setq Info-index-alternatives
+                ;; Weed out index entries that refer to the same line.
+                (seq-uniq
+                 (nconc exact (nreverse matches))
+                 (lambda (m1 m2)
+                   (and (equal (nth 1 m1) (nth 1 m2))
+                        (equal (nth 3 m1) (nth 3 m2))))))
          (Info-index-next 0)))))
 
 (defun Info-index-next (num)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]