GNU bug report logs - #59813
29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled

Previous Next

Package: emacs;

Reported by: Naofumi Yasufuku <naofumi <at> yasufuku.dev>

Date: Sun, 4 Dec 2022 09:45:02 UTC

Severity: normal

Tags: confirmed

Found in versions 29.0.60, 30.0.50

Full log


Message #23 received at 59813 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Naofumi Yasufuku <naofumi <at> yasufuku.dev>
Cc: 59813 <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#59813: 29.0.60;
 function-history: M-. fails to jump to defun if straight.el
 straight-cache-autoloads is enabled
Date: Wed, 14 Dec 2022 05:26:18 +0200
> Cc: 59813 <at> debbugs.gnu.org
> From: Naofumi Yasufuku <naofumi <at> yasufuku.dev>
> Date: Wed, 14 Dec 2022 05:20:20 +0900
> 
> 1. Create the following file
> 
> ~/.emacs.d/site-lisp/loadhist--foo.el
> 
> #+begin_src emacs-lisp
> (defun loadhist--foo-inc (x) (1+ x))
> (provide 'loadhist--foo)
> #+end_src
> 
> ----------------------------------------
> 2. emacs -Q
> 
> ----------------------------------------
> 3. Insert the following to *scratch*
> 
> #+begin_src emacs-lisp
> (setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
> (autoload 'loadhist--foo-inc "loadhist--foo")
> (message "(loadhist--foo-inc 1): %s" (loadhist--foo-inc 1))
> #+end_src
> 
> ----------------------------------------
> 4. In *scratch*, M-x eval-buffer
> 
> ----------------------------------------
> 5. M-. on `loadhist--foo-inc'
> =>
> xref--not-found-error: No definitions found for: loadhist--foo-inc
> 
> ----------------------------------------
> 6. In *scratch*, M-x eval-buffer again
> 
> ----------------------------------------
> 5. M-. on `loadhist--foo-inc'
> =>
> Jumps to defun in ~/.emacs.d/site-lisp/loadhist--foo.el

I'm not sure I understand the issue, and I'm not familiar with
straight.el, but if the above somehow prevents the function from being
loaded, it is expected that M-. will fail.  Its ELisp backend works
only for loaded functions.  If you want it to work for functions that
aren't loaded, you need to manually switch the backend to etags.

So if the above scenario worked with Emacs 28, I suggest to check
whether the function was being loaded with Emacs 28.




This bug report was last modified 1 year and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.