]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the bug with duplicate entries in xref output
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 24 Dec 2021 13:27:00 +0000 (15:27 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 24 Dec 2021 13:27:00 +0000 (15:27 +0200)
* lisp/progmodes/etags.el (xref-backend-definitions): Make sure to
save the changed intermediate value of the list (bug#52734).

lisp/progmodes/etags.el

index f53b09d9e8cc8d7e6f14159318fa01ccfb96c0c5..a63c3f33974bf276ba84801a3376d12c9428133b 100644 (file)
@@ -2084,14 +2084,15 @@ file name, add `tag-partial-file-name-match-p' to the list value.")
         (definitions (etags--xref-find-definitions symbol))
         same-file-definitions)
     (when (and etags-xref-prefer-current-file file)
-      (cl-delete-if
-       (lambda (definition)
-         (when (equal file
-                      (xref-location-group
-                       (xref-item-location definition)))
-           (push definition same-file-definitions)
-           t))
-       definitions)
+      (setq definitions
+            (cl-delete-if
+             (lambda (definition)
+               (when (equal file
+                            (xref-location-group
+                             (xref-item-location definition)))
+                 (push definition same-file-definitions)
+                 t))
+             definitions))
       (setq definitions (nconc (nreverse same-file-definitions)
                                definitions)))
     definitions))