unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>, David Fussner <dfussner@googlemail.com>
Cc: 52734@debbugs.gnu.org
Subject: bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplicates list
Date: Fri, 24 Dec 2021 02:27:45 +0200	[thread overview]
Message-ID: <e5e4bac4-87d0-30d1-9101-6930660f206d@yandex.ru> (raw)
In-Reply-To: <831r23wupq.fsf@gnu.org>

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	other threads:[~2021-12-24  0:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 15:01 bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplicates list David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-23  9:12 ` Eli Zaretskii
2021-12-24  0:27   ` Dmitry Gutov [this message]
2021-12-24  7:08     ` Eli Zaretskii
2021-12-24 13:09       ` David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-24 13:20         ` Eli Zaretskii
2021-12-24 13:27           ` Dmitry Gutov
2021-12-24  0:25 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5e4bac4-87d0-30d1-9101-6930660f206d@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=52734@debbugs.gnu.org \
    --cc=dfussner@googlemail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).