bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplica


From: Dmitry Gutov
Subject: bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplicates list
Date: Fri, 24 Dec 2021 02:27:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Eli,

On 23.12.2021 12:12, Eli Zaretskii wrote:
Dmitry, any comments?  The patch LGTM, FWIW.

How about the patch below instead?

And I'd like to apply it to emacs-28.

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index f53b09d9e8..a63c3f3397 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2084,14 +2084,15 @@ xref-backend-definitions
         (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))





reply via email to

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