From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Petteri Hintsanen Newsgroups: gmane.emacs.bugs Subject: bug#66683: 30.0.50; xref-find-references returns duplicates Date: Sun, 22 Oct 2023 18:29:58 +0300 Message-ID: <87h6mioetl.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24996"; mail-complaints-to="usenet@ciao.gmane.io" To: 66683@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 22 17:30:54 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1quaPm-0006MA-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Oct 2023 17:30:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quaPW-0005YA-0j; Sun, 22 Oct 2023 11:30:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quaPR-0005XD-W5 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 11:30:36 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quaPR-0004wE-NT for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 11:30:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quaPt-0007Rg-QY for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 11:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Petteri Hintsanen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2023 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66683 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169798864928597 (code B ref -1); Sun, 22 Oct 2023 15:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Oct 2023 15:30:49 +0000 Original-Received: from localhost ([127.0.0.1]:47909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quaPh-0007RB-A8 for submit@debbugs.gnu.org; Sun, 22 Oct 2023 11:30:49 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:49246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quaPd-0007Qt-5S for submit@debbugs.gnu.org; Sun, 22 Oct 2023 11:30:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quaP4-0005WC-UO for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 11:30:10 -0400 Original-Received: from sypressi2.dnainternet.net ([83.102.40.154]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quaP1-0004i8-Tb for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 11:30:10 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by sypressi2.dnainternet.net (Postfix) with ESMTP id 5CB8E11494; Sun, 22 Oct 2023 18:30:03 +0300 (EEST) X-Virus-Scanned: DNA Internet at dnainternet.net Original-Received: from sypressi2.dnainternet.net ([83.102.40.154]) by localhost (sypressi2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id jafZa3bAjuyy; Sun, 22 Oct 2023 18:30:02 +0300 (EEST) Original-Received: from omenapuu2.dnainternet.net (omenapuu2.dnainternet.net [83.102.40.54]) by sypressi2.dnainternet.net (Postfix) with ESMTP id 2DF281129C; Sun, 22 Oct 2023 18:30:02 +0300 (EEST) Original-Received: from romeo (62-78-178-196.bb.dnainternet.fi [62.78.178.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by omenapuu2.dnainternet.net (Postfix) with ESMTPS id CD28E221; Sun, 22 Oct 2023 18:29:59 +0300 (EEST) Received-SPF: neutral client-ip=83.102.40.154; envelope-from=petterih@iki.fi; helo=sypressi2.dnainternet.net X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272981 Archived-At: [This is a bug report from an old issue discussed in help-gnu-emacs@gnu.org (dated 19 Dec 2022, Message-ID <7ac4ca06-cbbb-1c8d-0f59-2ccd5d3232f2@iki.fi>). Dmitry Gutov asked me to file a bug, which I unfortunately forgot to do that time. Hence filing now.] I discovered a somewhat peculiar case where xref-find-references returns duplicate references for elisp symbols. Recipe: 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. C-x C-f ~/foo/bar/bar.el 5. M-x xref-find-references RET bar-f RET 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 (add-to-list 'load-path "~/foo") from step (3) above, then I don't see any duplicates. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.16.0) of 2023-10-22 built on romeo Repository revision: ae337884107c4d5f66aaceef0e8b548565317412 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux 12 (bookworm) Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK2 ZLIB Important settings: value of $LC_MESSAGES: en_US.UTF-8 value of $LANG: fi_FI.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: display-fill-column-indicator-mode: t bug-reference-prog-mode: t jinx-mode: t winner-mode: t savehist-mode: t minibuffer-electric-default-mode: t display-time-mode: t emms-playing-time-display-mode: t emms-playing-time-mode: t desktop-save-mode: t cwm-mode: t windmove-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t hs-minor-mode: t Load-path shadows: /home/phintsan/.emacs.d/elpa/transient-0.4.3/transient hides /home/phintsan/src/emacs/lisp/transient Features: (shadow mail-extr emacsbug message yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils hideshow display-fill-column-indicator bug-reference jinx compat ph-simple-theme rx winner ring savehist minibuf-eldef time emms-mpris pcase dbus emms-librefm-stream xml emms-librefm-scrobbler emms-playlist-limit emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-volume emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-lyrics emms-url time-date emms-streams emms-show-all emms-tag-editor format-spec emms-tag-tracktag emms-mark emms-mode-line emms-cache emms-info-native emms-info-native-spc emms-info-native-mp3 emms-info-native-ogg emms-info-native-opus emms-info-native-flac emms-info-native-vorbis bindat emms-info-exiftool emms-info-tinytag emms-info-metaflac emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mpv emms-playing-time emms-info emms-later-do emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file thingatpt locate dired dired-loaddefs emms-setup emms emms-compat desktop frameset cwm-mode windmove edmacro kmacro cl-extra help-mode use-package-bind-key bind-key easy-mmode finder-inf use-package-core cus-edit pp cus-load icons wid-edit ack-autoloads jinx-autoloads perl-doc-autoloads transient-autoloads with-editor-autoloads info compat-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 274554 22405) (symbols 48 13707 0) (strings 32 99822 3656) (string-bytes 1 2414869) (vectors 16 29913) (vector-slots 8 1123232 231495) (floats 8 86 55) (intervals 56 853 0) (buffers 992 10))