unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Naofumi Yasufuku <naofumi@yasufuku.dev>
Cc: 59813@debbugs.gnu.org, stefankangas@gmail.com
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	[thread overview]
Message-ID: <83h6xyoecl.fsf@gnu.org> (raw)
In-Reply-To: <86r0x312ez.fsf@yasufuku.dev> (message from Naofumi Yasufuku on Wed, 14 Dec 2022 05:20:20 +0900)

> 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.





  parent reply	other threads:[~2022-12-14  3:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04  9:44 bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled Naofumi Yasufuku
2022-12-13  1:20 ` Stefan Kangas
2022-12-13 20:20   ` Naofumi Yasufuku
2022-12-13 21:30     ` Stefan Kangas
2022-12-14 17:23       ` Naofumi Yasufuku
2022-12-14  3:26     ` Eli Zaretskii [this message]
2022-12-14 17:24       ` Naofumi Yasufuku
2022-12-14 17:34         ` Naofumi Yasufuku
2022-12-14 17:48           ` Naofumi Yasufuku

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h6xyoecl.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59813@debbugs.gnu.org \
    --cc=naofumi@yasufuku.dev \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).