unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
@ 2022-12-04  9:44 Naofumi Yasufuku
  2022-12-13  1:20 ` Stefan Kangas
  0 siblings, 1 reply; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-04  9:44 UTC (permalink / raw)
  To: 59813

Hello, Emacs

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


----------------------------------------
1. Create the following autoload files and init.el;

~/.emacs.d/site-lisp/loadhist--foo.el

#+begin_src emacs-lisp
(defun loadhist--foo-inc (x) (1+ x))
(provide 'loadhist--foo)
#+end_src

~/.emacs.d/site-lisp/loadhist--foo-autoloads.el

#+begin_src emacs-lisp
(autoload 'loadhist--foo-inc "loadhist--foo")
(provide 'loadhist--foo-autoloads)
#+end_src

~/.emacs.d/init.el

#+begin_src emacs-lisp
(setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))

;; BACKGROUND
;;
;; The following code is the way of straight.el autoloads cache:
;;
;; https://github.com/radian-software/straight.el/blob/master/straight.el
;;
;; straight--activate-package-autoloads
;; straight--read-package-autoloads
;;

(let ((load-file-name (locate-user-emacs-file "site-lisp/loadhist--foo-autoloads.el"))
      (load-in-progress t))
  (with-temp-buffer
    (insert-file-contents load-file-name)
    (let (autoloads)
      (condition-case _
          (while t
            (push (read (current-buffer)) autoloads))
        (end-of-file))
      (dolist (form (nreverse autoloads))
        (eval form)))))

(message "function-history A: %s" (get 'loadhist--foo-inc 'function-history))

;; M-. fails to jump to defun in loadhist--foo.el
;; if loadhist--foo.el is loaded:
(message "(loadhist--foo-inc 1): %s" (loadhist--foo-inc 1))

(message "function-history B: %s" (get 'loadhist--foo-inc 'function-history))
#+end_src


----------------------------------------
2. launch Emacs, and open init.el, then M-. on `loadhist--foo-inc';


----------------------------------------
3. M-. jumps to the head of init.el instead of defun in loadhist--foo.el;
   (MISBEHAVIOR)

   In *Messages*, (get 'loadhist--foo-inc 'function-history) says:

#+begin_example
function-history A: nil
(loadhist--foo-inc 1): 2
function-history B: (/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el (autoload loadhist--foo nil nil nil))
#+end_example


----------------------------------------
4. Comment out (loadhist--foo-inc 1) call in init.el, then do #2 again;

#+begin_src diff
--- init.el.orig	2022-12-04 16:16:01.513979076 +0900
+++ init.el	2022-12-04 16:17:34.347794827 +0900
@@ -26,6 +26,6 @@
 
 ;; M-. on `loadhist--foo-inc' fails to jump to defun in loadhist--foo.el
 ;; if loadhist--foo.el is loaded:
-(message "(loadhist--foo-inc 1): %s" (loadhist--foo-inc 1))
+;(message "(loadhist--foo-inc 1): %s" (loadhist--foo-inc 1))
 
 (message "function-history B: %s" (get 'loadhist--foo-inc 'function-history))
#+end_src


----------------------------------------
5. M-. jumps to defun in loadhist--foo.el;
   (EXPECTED)

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


I found that the following commit affects to this behavior.  If I revert
this commit, M-. jumps successfully even if loadhist--foo.el is
autoloaded by (loadhist--foo-inc 1) call in init.el.

----------------------------------------
bad 1d1b664fbb9232aa40d8daa54a689cfd63d38aa9
Author:     Stefan Monnier <monnier@iro.umontreal.ca>
AuthorDate: Mon Jan 31 11:07:06 2022 -0500
Commit:     Stefan Monnier <monnier@iro.umontreal.ca>
CommitDate: Mon Jan 31 11:07:26 2022 -0500

Parent:     90bbf27f02 Make Gnus address checking more resilient
Merged:     (no branch, bisect started on emacs-29)
Contained:  emacs-29
Follows:    emacs-27.1 (13597)

(function-history): New symbol property (bug#53632)
----------------------------------------


Best regards,
  Naofumi


In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2022-12-04 built on titan
Repository revision: 96af584af6c8ea50f9cf871db9ffca91040fb85d
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure 'CFLAGS=-g3 -O2' TMPDIR=/home/naofumi/tmp
 --prefix=/home/naofumi/.local/emacs/emacs-29 --with-x
 --with-x-toolkit=lucid --with-mailutils --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_TIME: C
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  org-superstar-mode: t
  toc-org-mode: t
  org-indent-mode: t
  org-num-mode: t
  editorconfig-mode: t
  delete-selection-mode: t
  global-so-long-mode: t
  recentf-mode: t
  global-whitespace-mode: t
  winner-mode: t
  diff-hl-flydiff-mode: t
  diff-hl-margin-local-mode: t
  diff-hl-margin-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  pyvenv-tracking-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  marginalia-mode: t
  vertico-mode: t
  savehist-mode: t
  corfu-history-mode: t
  corfu-indexed-mode: t
  corfu-terminal-mode: t
  windmove-mode: t
  disable-mouse-global-mode: t
  which-key-mode: t
  doom-modeline-mode: t
  global-corfu-mode: t
  corfu-mode: t
  projectile-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  global-auto-revert-mode: t
  shell-dirtrack-mode: t
  repeat-mode: t
  server-mode: t
  key-chord-mode: t
  override-global-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  straight-live-modifications-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-history-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/naofumi/.emacs.d/straight/build-29/ninja-mode/ninja-mode hides /usr/share/emacs/site-lisp/ninja-mode
/home/naofumi/.emacs.d/straight/build-29/cmake-mode/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/home/naofumi/.emacs.d/straight/build-29/transient/transient hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/transient
/home/naofumi/.emacs.d/straight/build-29/org/org-table hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-table
/home/naofumi/.emacs.d/straight/build-29/org/ob-ruby hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-ruby
/home/naofumi/.emacs.d/straight/build-29/org/org-agenda hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-agenda
/home/naofumi/.emacs.d/straight/build-29/org/org-protocol hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-protocol
/home/naofumi/.emacs.d/straight/build-29/org/org-num hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-num
/home/naofumi/.emacs.d/straight/build-29/org/org-keys hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-keys
/home/naofumi/.emacs.d/straight/build-29/org/org-goto hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-goto
/home/naofumi/.emacs.d/straight/build-29/org/org-feed hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-feed
/home/naofumi/.emacs.d/straight/build-29/org/org-fold hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-fold
/home/naofumi/.emacs.d/straight/build-29/org/org-faces hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-faces
/home/naofumi/.emacs.d/straight/build-29/org/org-cycle hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-cycle
/home/naofumi/.emacs.d/straight/build-29/org/ol-gnus hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-gnus
/home/naofumi/.emacs.d/straight/build-29/org/ol-docview hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-docview
/home/naofumi/.emacs.d/straight/build-29/org/oc-basic hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc-basic
/home/naofumi/.emacs.d/straight/build-29/org/ob-table hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-table
/home/naofumi/.emacs.d/straight/build-29/org/ob-screen hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-screen
/home/naofumi/.emacs.d/straight/build-29/org/ob-scheme hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-scheme
/home/naofumi/.emacs.d/straight/build-29/org/ob-octave hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-octave
/home/naofumi/.emacs.d/straight/build-29/org/ox-publish hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-publish
/home/naofumi/.emacs.d/straight/build-29/org/ox-koma-letter hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-koma-letter
/home/naofumi/.emacs.d/straight/build-29/org/org-tempo hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-tempo
/home/naofumi/.emacs.d/straight/build-29/org/org-src hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-src
/home/naofumi/.emacs.d/straight/build-29/org/ob-forth hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-forth
/home/naofumi/.emacs.d/straight/build-29/org/org-element hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-element
/home/naofumi/.emacs.d/straight/build-29/org/ob-latex hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-latex
/home/naofumi/.emacs.d/straight/build-29/org/org-macro hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-macro
/home/naofumi/.emacs.d/straight/build-29/org/ob-julia hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-julia
/home/naofumi/.emacs.d/straight/build-29/org/ob-eval hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-eval
/home/naofumi/.emacs.d/straight/build-29/org/ob-comint hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-comint
/home/naofumi/.emacs.d/straight/build-29/org/ob-lilypond hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-lilypond
/home/naofumi/.emacs.d/straight/build-29/org/ox-texinfo hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-texinfo
/home/naofumi/.emacs.d/straight/build-29/org/ob-emacs-lisp hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-emacs-lisp
/home/naofumi/.emacs.d/straight/build-29/org/ox-latex hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-latex
/home/naofumi/.emacs.d/straight/build-29/org/org-persist hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-persist
/home/naofumi/.emacs.d/straight/build-29/org/ox-icalendar hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-icalendar
/home/naofumi/.emacs.d/straight/build-29/org/org-pcomplete hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-pcomplete
/home/naofumi/.emacs.d/straight/build-29/org/org-macs hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-macs
/home/naofumi/.emacs.d/straight/build-29/org/org-loaddefs hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-loaddefs
/home/naofumi/.emacs.d/straight/build-29/org/org-indent hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-indent
/home/naofumi/.emacs.d/straight/build-29/org/org-footnote hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-footnote
/home/naofumi/.emacs.d/straight/build-29/org/org-fold-core hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-fold-core
/home/naofumi/.emacs.d/straight/build-29/org/org-ctags hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-ctags
/home/naofumi/.emacs.d/straight/build-29/org/org-colview hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-colview
/home/naofumi/.emacs.d/straight/build-29/org/org-crypt hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-crypt
/home/naofumi/.emacs.d/straight/build-29/org/org-compat hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-compat
/home/naofumi/.emacs.d/straight/build-29/org/org-archive hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-archive
/home/naofumi/.emacs.d/straight/build-29/org/ol-w3m hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-w3m
/home/naofumi/.emacs.d/straight/build-29/org/ol-rmail hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-rmail
/home/naofumi/.emacs.d/straight/build-29/org/ol-man hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-man
/home/naofumi/.emacs.d/straight/build-29/org/ol-irc hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-irc
/home/naofumi/.emacs.d/straight/build-29/org/ol-eshell hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-eshell
/home/naofumi/.emacs.d/straight/build-29/org/ol-bibtex hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-bibtex
/home/naofumi/.emacs.d/straight/build-29/org/ol-bbdb hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-bbdb
/home/naofumi/.emacs.d/straight/build-29/org/oc-bibtex hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc-bibtex
/home/naofumi/.emacs.d/straight/build-29/org/oc-biblatex hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc-biblatex
/home/naofumi/.emacs.d/straight/build-29/org/org hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org
/home/naofumi/.emacs.d/straight/build-29/org/ob-tangle hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-tangle
/home/naofumi/.emacs.d/straight/build-29/org/ob-sql hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-sql
/home/naofumi/.emacs.d/straight/build-29/org/ob-shell hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-shell
/home/naofumi/.emacs.d/straight/build-29/org/ob-sed hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-sed
/home/naofumi/.emacs.d/straight/build-29/org/ob-sass hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-sass
/home/naofumi/.emacs.d/straight/build-29/org/ob-ref hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-ref
/home/naofumi/.emacs.d/straight/build-29/org/ob-perl hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-perl
/home/naofumi/.emacs.d/straight/build-29/org/ob-org hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-org
/home/naofumi/.emacs.d/straight/build-29/org/ob-maxima hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-maxima
/home/naofumi/.emacs.d/straight/build-29/org/ob-fortran hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-fortran
/home/naofumi/.emacs.d/straight/build-29/org/ob-makefile hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-makefile
/home/naofumi/.emacs.d/straight/build-29/org/ob-lob hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-lob
/home/naofumi/.emacs.d/straight/build-29/org/ox-ascii hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-ascii
/home/naofumi/.emacs.d/straight/build-29/org/org-plot hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-plot
/home/naofumi/.emacs.d/straight/build-29/org/org-mobile hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-mobile
/home/naofumi/.emacs.d/straight/build-29/org/org-mouse hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-mouse
/home/naofumi/.emacs.d/straight/build-29/org/org-list hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-list
/home/naofumi/.emacs.d/straight/build-29/org/org-habit hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-habit
/home/naofumi/.emacs.d/straight/build-29/org/org-datetree hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-datetree
/home/naofumi/.emacs.d/straight/build-29/org/org-entities hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-entities
/home/naofumi/.emacs.d/straight/build-29/org/org-duration hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-duration
/home/naofumi/.emacs.d/straight/build-29/org/ox-html hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-html
/home/naofumi/.emacs.d/straight/build-29/org/org-capture hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-capture
/home/naofumi/.emacs.d/straight/build-29/org/ox-beamer hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-beamer
/home/naofumi/.emacs.d/straight/build-29/org/org-timer hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-timer
/home/naofumi/.emacs.d/straight/build-29/org/org-refile hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-refile
/home/naofumi/.emacs.d/straight/build-29/org/org-lint hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-lint
/home/naofumi/.emacs.d/straight/build-29/org/org-inlinetask hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-inlinetask
/home/naofumi/.emacs.d/straight/build-29/org/org-id hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-id
/home/naofumi/.emacs.d/straight/build-29/org/org-clock hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-clock
/home/naofumi/.emacs.d/straight/build-29/org/org-attach hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-attach
/home/naofumi/.emacs.d/straight/build-29/org/org-attach-git hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-attach-git
/home/naofumi/.emacs.d/straight/build-29/org/ox-man hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-man
/home/naofumi/.emacs.d/straight/build-29/org/ol-mhe hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-mhe
/home/naofumi/.emacs.d/straight/build-29/org/ol-eww hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-eww
/home/naofumi/.emacs.d/straight/build-29/org/ol-info hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-info
/home/naofumi/.emacs.d/straight/build-29/org/ol-doi hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol-doi
/home/naofumi/.emacs.d/straight/build-29/org/oc-csl hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc-csl
/home/naofumi/.emacs.d/straight/build-29/org/oc-natbib hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc-natbib
/home/naofumi/.emacs.d/straight/build-29/org/ox-odt hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-odt
/home/naofumi/.emacs.d/straight/build-29/org/ob hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob
/home/naofumi/.emacs.d/straight/build-29/org/ob-sqlite hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-sqlite
/home/naofumi/.emacs.d/straight/build-29/org/ox-org hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-org
/home/naofumi/.emacs.d/straight/build-29/org/ob-python hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-python
/home/naofumi/.emacs.d/straight/build-29/org/ob-processing hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-processing
/home/naofumi/.emacs.d/straight/build-29/org/ob-plantuml hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-plantuml
/home/naofumi/.emacs.d/straight/build-29/org/ob-ocaml hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-ocaml
/home/naofumi/.emacs.d/straight/build-29/org/ox-md hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox-md
/home/naofumi/.emacs.d/straight/build-29/org/ob-lua hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-lua
/home/naofumi/.emacs.d/straight/build-29/org/ob-matlab hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-matlab
/home/naofumi/.emacs.d/straight/build-29/org/ob-lisp hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-lisp
/home/naofumi/.emacs.d/straight/build-29/org/ob-haskell hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-haskell
/home/naofumi/.emacs.d/straight/build-29/org/ob-groovy hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-groovy
/home/naofumi/.emacs.d/straight/build-29/org/ob-gnuplot hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-gnuplot
/home/naofumi/.emacs.d/straight/build-29/org/ob-eshell hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-eshell
/home/naofumi/.emacs.d/straight/build-29/org/ob-core hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-core
/home/naofumi/.emacs.d/straight/build-29/org/ob-clojure hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-clojure
/home/naofumi/.emacs.d/straight/build-29/org/ob-exp hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-exp
/home/naofumi/.emacs.d/straight/build-29/org/ob-awk hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-awk
/home/naofumi/.emacs.d/straight/build-29/org/ol hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ol
/home/naofumi/.emacs.d/straight/build-29/org/oc hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/oc
/home/naofumi/.emacs.d/straight/build-29/org/ox hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ox
/home/naofumi/.emacs.d/straight/build-29/org/ob-java hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-java
/home/naofumi/.emacs.d/straight/build-29/org/ob-ditaa hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-ditaa
/home/naofumi/.emacs.d/straight/build-29/org/ob-js hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-js
/home/naofumi/.emacs.d/straight/build-29/org/ob-css hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-css
/home/naofumi/.emacs.d/straight/build-29/org/ob-calc hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-calc
/home/naofumi/.emacs.d/straight/build-29/org/ob-R hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-R
/home/naofumi/.emacs.d/straight/build-29/org/ob-C hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-C
/home/naofumi/.emacs.d/straight/build-29/org/ob-dot hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/ob-dot
/home/naofumi/.emacs.d/straight/build-29/org/org-version hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/org/org-version
/home/naofumi/.emacs.d/straight/build-29/let-alist/let-alist hides /home/naofumi/.local/emacs/emacs-29/share/emacs/29.0.60/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug dired-aux vc-hg vc-git vc-bzr vc-src
vc-sccs vc-cvs vc-rcs gnus-dired vertico-directory cursor-sensor
vertico-repeat pulse help-fns consult-xref affe consult-vertico consult
compat-28 magit-bookmark bookmark mule-util cape org-duration org-clock
diary-lib diary-loaddefs org-eldoc org-superstar toc-org org-indent
org-num oc-basic vc-svn face-remap editorconfig editorconfig-core
editorconfig-core-handle editorconfig-fnmatch skk-cursor ccc skk-sticky
skk-dcomp skk-comp skk-look skk-server skk-study skk-hint skk-cus
skk-emacs skk-macs skk-vars skk delsel so-long recentf-ext recentf
tree-widget whitespace winner diff-hl-flydiff diff-hl-margin
diff-hl-dired diff-hl log-view vc-dir pyvenv eshell esh-cmd esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-start
yasnippet marginalia vertico savehist corfu-history corfu-indexed
corfu-terminal win-switch windmove disable-mouse which-key doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core
all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons shrink-path f
f-shortdoc shortdoc doom-tomorrow-night-theme doom-themes
doom-themes-base doom-themes-autoloads base16-tomorrow-night-theme
base16-theme base16-theme-autoloads doom-modeline-autoloads
shrink-path-autoloads all-the-icons-autoloads vlf-setup vlf-autoloads
helpful-autoloads elisp-refs-autoloads which-key-autoloads
disable-mouse-autoloads multiple-cursors-autoloads shell-pop term
disp-table ehelp shell-pop-autoloads win-switch-autoloads w3m-autoloads
multi-vterm-autoloads vterm-autoloads multi-term-autoloads ace-link avy
ace-link-autoloads ace-jump-buffer-autoloads affe-autoloads
cape-autoloads kind-icon svg-lib kind-icon-autoloads svg-lib-autoloads
corfu-terminal-autoloads popon popon-autoloads corfu-quick corfu-info
corfu corfu-autoloads vertico-autoloads orderless orderless-autoloads
embark-consult-autoloads embark-autoloads consult-yasnippet-autoloads
consult-lsp-autoloads consult-eglot-autoloads consult-dir-autoloads
consult-ag-autoloads consult-autoloads marginalia-autoloads migemo
migemo-autoloads visual-regexp-steroids-autoloads
visual-regexp-autoloads symbol-overlay-autoloads wgrep-ag-autoloads
ag-autoloads rg files-x vc vc-dispatcher rg-info-hack rg-menu rg-ibuffer
rg-result wgrep-rg wgrep rg-history rg-header cus-edit cus-load
rg-autoloads wgrep-autoloads smart-jump-python smart-jump-lisp-mode
smart-jump-elisp-mode smart-jump-cc-mode smart-jump smart-jump-autoloads
dumb-jump popup hydra lv dumb-jump-autoloads popup-autoloads
dap-mode-autoloads lsp-docker-autoloads lsp-treemacs-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads hydra-autoloads
pfuture-autoloads ace-window-autoloads avy-autoloads bui-autoloads
lsp-mode-autoloads lv-autoloads ht-autoloads eglot array jsonrpc ert pp
ewoc xref flymake-proc flymake imenu-list-autoloads yasnippet-autoloads
devdocs-autoloads android-mode-autoloads grip-mode-autoloads
markdown-preview-mode-autoloads web-server-autoloads
markdown-toc-autoloads gradle-mode-autoloads ninja-mode-autoloads
meson-mode-autoloads cmake-mode-autoloads powershell-autoloads
csv-mode-autoloads toml-mode-autoloads yaml-mode-autoloads
groovy-mode-autoloads kotlin-mode-autoloads rng-nxml rng-valid nxml-mode
nxml-outln nxml-rap sgml-mode facemenu web-mode-autoloads
go-mode-autoloads rustic-autoloads xterm-color-autoloads
spinner-autoloads rust-mode-autoloads haskell-mode-autoloads
ein-autoloads polymode-autoloads deferred-autoloads request-autoloads
anaphora-autoloads websocket-autoloads pipenv-autoloads
load-env-vars-autoloads pyvenv-autoloads slime-autoloads
macrostep-autoloads editorconfig-autoloads org-projectile s projectile
grep compile ibuf-ext ibuffer ibuffer-loaddefs org-category-capture
org-capture org-projectile-autoloads org-category-capture-autoloads
projectile-autoloads git-timemachine-autoloads git-modes-autoloads
diff-hl-autoloads orgit-forge orgit-forge-autoloads forge-list
forge-commands forge-semi forge-bitbucket buck forge-gogs gogs
forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub let-alist forge-notify forge-revnote forge-pullreq
forge-issue forge-topic yaml bug-reference forge-post markdown-mode
color forge-repo forge forge-core forge-db closql emacsql-sqlite advice
emacsql emacsql-compiler forge-autoloads yaml-autoloads
markdown-mode-autoloads ghub-autoloads treepy-autoloads
let-alist-autoloads orgit orgit-autoloads magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func imenu edebug debug backtrace
magit-diff smerge-mode diff diff-mode git-commit log-edit pcvs-util
add-log magit-core magit-autorevert autorevert magit-margin
magit-transient magit-process with-editor magit-mode magit-git
magit-base magit-section crm compat-27 compat-26 magit-autoloads
transient git-commit-autoloads transient-autoloads nhexl-mode-autoloads
mu4e-maildirs-extension-autoloads mu4e-autoloads notmuch-autoloads
ob-plantuml plantuml-mode dash plantuml-mode-autoloads ox-gfm ox-md
ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn
nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar
org-agenda ox-html table ox-ascii ox-publish ox ox-gfm-autoloads
org-tree-slide-autoloads toc-org-autoloads org-roam-autoloads
magit-section-autoloads org-download org-element org-persist avl-tree
generator org-attach org-id org-refile url-http url-auth url-gw nsm
async org-download-autoloads async-autoloads org-superstar-autoloads
ob-shell shell ob-screen ob-python python project compat compat-macs
treesit ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs ol-eww eww xdg url-queue thingatpt
mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu
mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus
xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range message sendmail yank-media puny rfc822 mml mml-sec
epa derived epg rfc6068 mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util text-property-search mail-utils range mm-util
mail-prsvr wid-edit ol-docview doc-view filenotify jka-compr image-mode
exif dired dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org-tempo tempo org-contrib org-contrib-autoloads org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint
org-pcomplete pcomplete comint ansi-osc ansi-color ring org-list
org-footnote org-faces org-entities time-date noutline outline
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold
org-fold-core org-keys oc org-loaddefs find-func org-version org-compat
org-macs format-spec japanese-holidays holidays holiday-loaddefs
japanese-holidays-autoloads cal-iso cal-menu calendar cal-loaddefs
pass-autoloads f-autoloads dash-autoloads password-store-otp-autoloads
password-store-autoloads with-editor-autoloads s-autoloads
auth-source-pass epg-config sr-speedbar-autoloads recentf-ext-autoloads
cua-base dabbrev repeat ddskk-autoloads cdb-autoloads ccc-autoloads
edmacro kmacro exec-path-from-shell exec-path-from-shell-autoloads
finder-inf epkg-autoloads closql-autoloads emacsql-sqlite-autoloads
emacsql-autoloads package-utils package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source eieio eieio-core
password-cache json map url-vars package-utils-autoloads restart-emacs
desktop frameset server restart-emacs-autoloads use-package-chords
bind-chord use-package-chords-autoloads bind-chord-autoloads key-chord
comp comp-cstr warnings icons rx key-chord-autoloads diminish
diminish-autoloads compat-autoloads use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
use-package-core use-package-autoloads bind-key-autoloads straight-x
straight-autoloads cl-extra help-mode straight info loaddefs-gen
generate-lisp-file lisp-mnt radix-tree easy-mmode cl-seq pcase subr-x
byte-opt cl-macs gv bytecomp byte-compile cl-loaddefs cl-lib japan-util
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 920456 723010)
 (symbols 48 63625 3)
 (strings 32 228522 94343)
 (string-bytes 1 9309551)
 (vectors 16 131121)
 (vector-slots 8 2921605 956589)
 (floats 8 1490 3522)
 (intervals 56 15797 723)
 (buffers 992 43))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2022-12-13  1:20 UTC (permalink / raw)
  To: Naofumi Yasufuku; +Cc: 59813

Naofumi Yasufuku <naofumi@yasufuku.dev> writes:

> Hello, Emacs
>
> 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?

Did you report this to the straight developers first?

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-13  1:20 ` Stefan Kangas
@ 2022-12-13 20:20   ` Naofumi Yasufuku
  2022-12-13 21:30     ` Stefan Kangas
  2022-12-14  3:26     ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-13 20:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 59813

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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2022-12-13 21:30 UTC (permalink / raw)
  To: Naofumi Yasufuku; +Cc: 59813

tags 59813 + confirm
found 59813 30.0.50
thanks

Naofumi Yasufuku <naofumi@yasufuku.dev> writes:

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

Thanks for the clear recipe.

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

Something definitely seems wrong with the autoloading and/or xref here.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-13 20:20   ` Naofumi Yasufuku
  2022-12-13 21:30     ` Stefan Kangas
@ 2022-12-14  3:26     ` Eli Zaretskii
  2022-12-14 17:24       ` Naofumi Yasufuku
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-14  3:26 UTC (permalink / raw)
  To: Naofumi Yasufuku; +Cc: 59813, stefankangas

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-13 21:30     ` Stefan Kangas
@ 2022-12-14 17:23       ` Naofumi Yasufuku
  0 siblings, 0 replies; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-14 17:23 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 59813

Hi Stefan,

Stefan Kangas <stefankangas@gmail.com> 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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-14  3:26     ` Eli Zaretskii
@ 2022-12-14 17:24       ` Naofumi Yasufuku
  2022-12-14 17:34         ` Naofumi Yasufuku
  0 siblings, 1 reply; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-14 17:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 59813, stefankangas

Hi Eli,

Eli Zaretskii <eliz@gnu.org> writes:

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

The function `loadhist--foo-inc' is definitely loaded by autoload,
but M-. fails to find defun in the source file loadhist--foo.el.

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

I've tried to check the state of load-history (both 28 and 29) and
function-history (29-only).  The following is the difference between
Emacs 28 and 29:

;;==========================================
;; Emacs 28.2.50

;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
;;------------------------------------------
;; (defun loadhist--foo-inc (x) (1+ x))
;; (provide 'loadhist--foo)
;;------------------------------------------

;; Step 2: emacs -Q

;; Step 3: In *scratch*, M-x eval-buffer

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

;;------------------------------------------
;; Step 4: Check load-history

(symbol-file 'loadhist--foo-inc 'defun)
=> "/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el"

(let (matches)
  (pcase-dolist (`(,file . ,elems) load-history)
    (when (rassq 'loadhist--foo-inc elems)
      (push (cons file elems) matches)))
  (nreverse matches))
=> ((nil (autoload . loadhist--foo-inc)) ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (t . loadhist--foo-inc) (defun . loadhist--foo-inc) (provide . loadhist--foo)))

;;==========================================

;;==========================================
;; Emacs 29.0.60

;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
;;------------------------------------------
;; (defun loadhist--foo-inc (x) (1+ x))
;; (provide 'loadhist--foo)
;;------------------------------------------

;; Step 2: emacs -Q

;; Step 3: In *scratch*, M-x eval-buffer

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

;;------------------------------------------
;; Step 4: Check load-history and function-history

(symbol-file 'loadhist--foo-inc 'defun)
=> nil

(let (matches)
  (pcase-dolist (`(,file . ,elems) load-history)
    (when (rassq 'loadhist--foo-inc elems)
      (push (cons file elems) matches)))
  (nreverse matches))
=> ((nil (defun . loadhist--foo-inc)) ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (defun . loadhist--foo-inc) (provide . loadhist--foo)))

(get 'loadhist--foo-inc 'function-history)
=> ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (autoload "loadhist--foo" nil nil nil))

;;==========================================


Best regaards,
  Naofumi





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-14 17:24       ` Naofumi Yasufuku
@ 2022-12-14 17:34         ` Naofumi Yasufuku
  2022-12-14 17:48           ` Naofumi Yasufuku
  0 siblings, 1 reply; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-14 17:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 59813, stefankangas

Naofumi Yasufuku <naofumi@yasufuku.dev> writes:

> Hi Eli,
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
>> 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.
>>
>
> The function `loadhist--foo-inc' is definitely loaded by autoload,
> but M-. fails to find defun in the source file loadhist--foo.el.
>
>> So if the above scenario worked with Emacs 28, I suggest to check
>> whether the function was being loaded with Emacs 28.
>
> I've tried to check the state of load-history (both 28 and 29) and
> function-history (29-only).  The following is the difference between
> Emacs 28 and 29:
>
> ;;==========================================
> ;; Emacs 28.2.50
>
> ;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
> ;;------------------------------------------
> ;; (defun loadhist--foo-inc (x) (1+ x))
> ;; (provide 'loadhist--foo)
> ;;------------------------------------------
>
> ;; Step 2: emacs -Q
>
> ;; Step 3: In *scratch*, M-x eval-buffer
>
> (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))
>
> ;;------------------------------------------
> ;; Step 4: Check load-history
>
> (symbol-file 'loadhist--foo-inc 'defun)
> => "/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el"
>
> (let (matches)
>   (pcase-dolist (`(,file . ,elems) load-history)
>     (when (rassq 'loadhist--foo-inc elems)
>       (push (cons file elems) matches)))
>   (nreverse matches))
> => ((nil (autoload . loadhist--foo-inc)) ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (t . loadhist--foo-inc) (defun . loadhist--foo-inc) (provide . loadhist--foo)))
>
> ;;==========================================
>
> ;;==========================================
> ;; Emacs 29.0.60
>
> ;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
> ;;------------------------------------------
> ;; (defun loadhist--foo-inc (x) (1+ x))
> ;; (provide 'loadhist--foo)
> ;;------------------------------------------
>
> ;; Step 2: emacs -Q
>
> ;; Step 3: In *scratch*, M-x eval-buffer
>
> (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))
>
> ;;------------------------------------------
> ;; Step 4: Check load-history and function-history
>
> (symbol-file 'loadhist--foo-inc 'defun)
> => nil
>
> (let (matches)
>   (pcase-dolist (`(,file . ,elems) load-history)
>     (when (rassq 'loadhist--foo-inc elems)
>       (push (cons file elems) matches)))
>   (nreverse matches))
> => ((nil (defun . loadhist--foo-inc)) ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (defun . loadhist--foo-inc) (provide . loadhist--foo)))
>
> (get 'loadhist--foo-inc 'function-history)
> => ("/home/naofumi/.emacs.d/site-lisp/loadhist--foo.el" (autoload "loadhist--foo" nil nil nil))
>
> ;;==========================================
>

If 3rd (message .. (loadhist--foo-inc 1)) is not exist and only autoload
is evaluated, there is no differnce between Emacs 28 and 29:

;;==========================================
;; Emacs 28.2.50

;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
;;------------------------------------------
;; (defun loadhist--foo-inc (x) (1+ x))
;; (provide 'loadhist--foo)
;;------------------------------------------

;; Step 2: emacs -Q

;; Step 3: In *scratch*, M-x eval-buffer

(setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
(autoload 'loadhist--foo-inc "loadhist--foo")

;;------------------------------------------
;; Step 4: Check load-history

(symbol-file 'loadhist--foo-inc 'defun)
=> "loadhist--foo"

(let (matches)
  (pcase-dolist (`(,file . ,elems) load-history)
    (when (rassq 'loadhist--foo-inc elems)
      (push (cons file elems) matches)))
  (nreverse matches))
=> ((nil (autoload . loadhist--foo-inc)))

;;==========================================


;;==========================================
;; Emacs 29.0.60

;; Step 1: Create ~/.emacs.d/site-lisp/loadhist--foo.el
;;------------------------------------------
;; (defun loadhist--foo-inc (x) (1+ x))
;; (provide 'loadhist--foo)
;;------------------------------------------

;; Step 2: emacs -Q

;; Step 3: In *scratch*, M-x eval-buffer

(setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
(autoload 'loadhist--foo-inc "loadhist--foo")

;;------------------------------------------
;; Step 4: Check load-history and function-history

(symbol-file 'loadhist--foo-inc 'defun)
=> "loadhist--foo"

(let (matches)
  (pcase-dolist (`(,file . ,elems) load-history)
    (when (rassq 'loadhist--foo-inc elems)
      (push (cons file elems) matches)))
  (nreverse matches))
=> ((nil (defun . loadhist--foo-inc)))

(get 'loadhist--foo-inc 'function-history)
=> nil

;;==========================================


Best regards,
  Naofumi





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled
  2022-12-14 17:34         ` Naofumi Yasufuku
@ 2022-12-14 17:48           ` Naofumi Yasufuku
  0 siblings, 0 replies; 9+ messages in thread
From: Naofumi Yasufuku @ 2022-12-14 17:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 59813, stefankangas

Naofumi Yasufuku <naofumi@yasufuku.dev> writes:

>
> If 3rd (message .. (loadhist--foo-inc 1)) is not exist and only autoload
> is evaluated, there is no differnce between Emacs 28 and 29:
>

Sorry. In autoload-only case, the difference is just
Emacs 29 (defun. loadhist--foo-inc) and
Emacs 28 (autoload . loadhist--foo-inc).

`symbol-file' returns autoload file.


> ;;==========================================
> ;; Emacs 28.2.50
>
[..snip..]
>
> ;; Step 3: In *scratch*, M-x eval-buffer
>
> (setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
> (autoload 'loadhist--foo-inc "loadhist--foo")
>
> ;;------------------------------------------
> ;; Step 4: Check load-history
>
> (symbol-file 'loadhist--foo-inc 'defun)
> => "loadhist--foo"
>
> (let (matches)
>   (pcase-dolist (`(,file . ,elems) load-history)
>     (when (rassq 'loadhist--foo-inc elems)
>       (push (cons file elems) matches)))
>   (nreverse matches))
> => ((nil (autoload . loadhist--foo-inc)))
>
> ;;==========================================
>
>
> ;;==========================================
> ;; Emacs 29.0.60
>
[..snip..]
>
> ;; Step 3: In *scratch*, M-x eval-buffer
>
> (setq load-path (cons (locate-user-emacs-file "site-lisp") load-path))
> (autoload 'loadhist--foo-inc "loadhist--foo")
>
> ;;------------------------------------------
> ;; Step 4: Check load-history and function-history
>
> (symbol-file 'loadhist--foo-inc 'defun)
> => "loadhist--foo"
>
> (let (matches)
>   (pcase-dolist (`(,file . ,elems) load-history)
>     (when (rassq 'loadhist--foo-inc elems)
>       (push (cons file elems) matches)))
>   (nreverse matches))
> => ((nil (defun . loadhist--foo-inc)))
>
> (get 'loadhist--foo-inc 'function-history)
> => nil
>
> ;;==========================================
>

Regards,
  Naofumi





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-14 17:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-12-14 17:24       ` Naofumi Yasufuku
2022-12-14 17:34         ` Naofumi Yasufuku
2022-12-14 17:48           ` Naofumi Yasufuku

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