Hello list,
I discovered a somewhat peculiar case where xref-find-references returns
duplicate references for elisp symbols.
Here is a toy example:
1. Create a file ~/foo/bar/bar.el with contents:
(defun bar-f ())
(defun bar-g ()
(bar-f))
(provide 'bar)
2. Create a git repo in ~/foo/bar and commit bar.el. This is just to
set up a project that Emacs can recognize.
3. Start emacs -Q and eval
(add-to-list 'load-path "~/foo")
(add-to-list 'load-path "~/foo/bar")
(require 'bar)
4. Visit ~/foo/bar/bar.el and do xref-find-references for bar-f
On my machine I get
bar.el
1: (defun bar-f ())
4: (bar-f))
1: (defun bar-f ())
4: (bar-f))
i.e. references are duplicated. The issue seems to be in load-path: if
I remove ~/foo from step (3) above, then I don't see any duplicates.
Am I abusing load-path somehow, or is this a bug, or something else?