From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Naofumi Yasufuku Newsgroups: gmane.emacs.bugs Subject: bug#59813: 29.0.60; function-history: M-. fails to jump to defun if straight.el straight-cache-autoloads is enabled Date: Thu, 15 Dec 2022 02:34:11 +0900 Message-ID: <86a63p28ks.fsf@yasufuku.dev> References: <86fsdvmrkf.fsf@yasufuku.dev> <86r0x312ez.fsf@yasufuku.dev> <83h6xyoecl.fsf@gnu.org> <86cz8l291r.fsf@yasufuku.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23528"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59813@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 14 18:35:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5Vf1-0005np-Dc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Dec 2022 18:35:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5Veq-00057M-4T; Wed, 14 Dec 2022 12:35:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5Veo-00057D-Pz for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 12:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5Veo-0004m0-GT for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 12:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5Veo-0005hP-3S for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 12:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Naofumi Yasufuku Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2022 17:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed moreinfo Original-Received: via spool by 59813-submit@debbugs.gnu.org id=B59813.167103926821890 (code B ref 59813); Wed, 14 Dec 2022 17:35:02 +0000 Original-Received: (at 59813) by debbugs.gnu.org; 14 Dec 2022 17:34:28 +0000 Original-Received: from localhost ([127.0.0.1]:40588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5VeF-0005h0-Go for submit@debbugs.gnu.org; Wed, 14 Dec 2022 12:34:28 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5VeC-0005gu-3p for 59813@debbugs.gnu.org; Wed, 14 Dec 2022 12:34:26 -0500 Original-Received: (Authenticated sender: naofumi@yasufuku.dev) by mail.gandi.net (Postfix) with ESMTPSA id 308EA40002; Wed, 14 Dec 2022 17:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yasufuku.dev; s=gm1; t=1671039258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P2JAhANBu5EE5+A+xEvE3otQycRC8fB7pBHBeBp0qeM=; b=ax+UGCEgZr7SzShtvutlSGgAFIIo7BQPJGtpWwtpVAuKuAqsbJj+Ro8OEoKuwzjnOzHLQy VNmTqRM1NV2zbBGkDD/YWTiaD45w+/9WBMHpHevyC4pZSjsT7j/ZwBO9PRDxggs8ThhGRD VnuxitvjkYFg/Xda+6w8mUaGJsNzkjxjNS0IjgqwkdHsCSJDStRpsB6b3qQ1ZTW5r3SFg3 9atdoremZC29F3EhUZ/XDltlPTxvgKvfgKkleTNN4AHy4SzTsE5f15mzyj+y5FIr5S6K3F mUgpPTLIed/ffOmPMKF275alay1YkaKJZHXAWsQrWIKFLF9Y+3OmUL9OAI/Atw== In-Reply-To: <86cz8l291r.fsf@yasufuku.dev> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250976 Archived-At: Naofumi Yasufuku writes: > Hi Eli, > > Eli Zaretskii 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