[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: |
Eli Zaretskii |
Subject: |
bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplicates list |
Date: |
Thu, 23 Dec 2021 11:12:33 +0200 |
> Date: Wed, 22 Dec 2021 15:01:54 +0000
> From: David Fussner via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> When `etags-xref-prefer-current-file' is t and only the current file
> contains (multiple) definitions of the same function, the list returns
> each tag twice. To reproduce:
>
> cd src/
> ../lib-src/etags term.c
> ./emacs -Q term.c
> C-s tty_free_frame_resources RTN
> M-. RTN
>
> src/term.c
> 3786: tty_free_frame_resources
> 3798: tty_free_frame_resources
>
> (setq etags-xref-prefer-current-file t)
> M-.
>
> src/term.c
> 3786: tty_free_frame_resources
> 3798: tty_free_frame_resources
> 3786: tty_free_frame_resources
> 3798: tty_free_frame_resources
>
> The variable is new in 28.1, so I thought the bug might want fixing on
> this branch. In my testing, cl-delete appears not to delete ITEMs from
> SEQ if such deletion would leave SEQ empty. I can't find this behavior
> documented anywhere, but I may be looking in the wrong places.
>
> Patch attached, which just tests for equality of the two lists of
> definitions, and only returns one of them in that case.
Dmitry, any comments? The patch LGTM, FWIW.
bug#52734: 28.0.90; [PATCH] xref-backend-definitions in etags.el duplicates list, Dmitry Gutov, 2021/12/23