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

From: Naofumi Yasufuku <[email-masked]>
Date: Thu, 15 Dec 2022 02:23:28 +0900

Hi Stefan,

Stefan Kangas <[email-masked]> writes:

>
> I can reproduce this on master, but not every time.  Sometimes it works
> even after one `eval-buffer'.  For some reason, it seems to work more
> often when I remove the third line with `message'?
>

On my systems (debian bullseye box and x86 macOS laptop), M-. failure
happens every time.  If the third (message .. (loadhist--foo-inc 1)) is
not exist, M-. on `loadhist--foo-inc' works:

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

If the third (message .. (loadhist--foo-inc 1)) is replaced with
`require', M-. on `loadhist--foo-inc' also fails:

#+begin_src emacs-lisp
(setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
(autoload 'loadhist--foo-inc "loadhist--foo")
(require 'loadhist--foo)
#+end_src

It is that I actually noticed this issue for the first time.

Best regards,
  Naofumi