bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59813: 29.0.60; function-history: M-. fails to jump to defun if stra


From: Eli Zaretskii
Subject: 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@debbugs.gnu.org
> From: Naofumi Yasufuku <naofumi@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]