summaryrefslogtreecommitdiff
path: root/lisp/progmodes/etags.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-25 06:32:13 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-25 06:32:13 +0100
commita1b72008a7228a65af819118d6de620b89d0e0d4 (patch)
treebec6626189d4fe864f5808b147626c208ef95dc7 /lisp/progmodes/etags.el
parent1faa1726f093886446879180997d8bd7426b30eb (diff)
parentc09ad0cabde922374c1a34350595a3141ab7f806 (diff)
downloademacs-a1b72008a7228a65af819118d6de620b89d0e0d4.tar.gz
Merge from origin/emacs-28
c09ad0cabd Fix the bug with duplicate entries in xref output
Diffstat (limited to 'lisp/progmodes/etags.el')
-rw-r--r--lisp/progmodes/etags.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index d7dbaa06505..348160ef50d 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2088,14 +2088,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))