all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Naofumi Yasufuku <naofumi@yasufuku.dev>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 59813@debbugs.gnu.org
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:20:20 +0900	[thread overview]
Message-ID: <86r0x312ez.fsf@yasufuku.dev> (raw)
In-Reply-To: <CADwFkm=FmgyFCAAkn0OPWhK4VBwMgaMkfgmP_dg5NswheH4fQA@mail.gmail.com>

Hello Stefan,

Stefan Kangas <stefankangas@gmail.com> writes:
>>
>> M-. fails to jump to defun if autoload forms are evaluated in init.el
>> without `load'; it is the way of straight.el autoloads cache feature
>> (enabled by default):
>>
>>   https://github.com/radian-software/straight.el/blob/master/straight.el
>>
>>   straight--activate-package-autoloads
>>   straight--read-package-autoloads
>
> What makes you think this is a bug in Emacs, and not in straight?
>

I thought that it could be an issue of Emacs-side because:

a) What straight.el does is just `eval' of autoload forms;
b) M-. failure is reproducible without straight.el;
c) Autoloading itself works fine even if autoload forms are evaluated
   without `load';
d) It works well with Emacs <= 28;

> Did you report this to the straight developers first?
>

No, I didn't.  But the following Github issue might be the same:

  C-h f for some functions link to the loading file instead of their source file:
  https://github.com/radian-software/straight.el/issues/1022


I tried to find more simple recipe.  Could you try this with emacs-29
or master?

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

----------------------------------------


Best regards,
  Naofumi






  reply	other threads:[~2022-12-13 20:20 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 [this message]
2022-12-13 21:30     ` Stefan Kangas
2022-12-14 17:23       ` Naofumi Yasufuku
2022-12-14  3:26     ` Eli Zaretskii
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

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

  git send-email \
    --in-reply-to=86r0x312ez.fsf@yasufuku.dev \
    --to=naofumi@yasufuku.dev \
    --cc=59813@debbugs.gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.