GNU bug report logs - #68818
[PATCH] lisp/emacs-lisp/inline.el: Autoload public macros

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ihor Radchenko <yantar92@HIDDEN>; Keywords: patch; Done: Stefan Monnier <monnier@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 68818 <at> debbugs.gnu.org and Ihor Radchenko <yantar92@HIDDEN> Request was from Stefan Monnier <monnier@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 18 Nov 2025 22:34:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 18 17:34:37 2025
Received: from localhost ([127.0.0.1]:60173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLUHU-00080f-Or
	for submit <at> debbugs.gnu.org; Tue, 18 Nov 2025 17:34:37 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56630)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vLUHS-00080L-OS
 for 68818 <at> debbugs.gnu.org; Tue, 18 Nov 2025 17:34:35 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5DB4D81C86;
 Tue, 18 Nov 2025 17:34:29 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763505268;
 bh=bJIDbQRrXpIExG2jYbULhFmf9xPsH2jodFYGnv5qDI8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=BwJtz7wT9vkUI9nvYUXfQarTqPkANEA85QNkfEjWbjo0hIdMynde6a5A/A4rfggLQ
 7/SmXh7A5nsZ3UM19qGXDxOFsLXfq4QO+vDQ9TQC6R0+K3t1C8DVlwdoNYMOe9J+p8
 hzjMUDH4oNJJg+xa8WA9+EGPz1XaCR7YRtGrDT3ghHuuUwo4KN4/AVyukBEeCrLqqY
 hllaFnSwz5gRL/H0TaOCXdhlUF2obnVGaY9Le6qJyLTr8CVs2hSGW2qlYRNHfCEhOF
 nKQ8hEvalQMFocMYdj/EuminXmPhkE0M+8BMuy2edDRiiewvFlv+r3jJ0duFGkBda3
 Myx+ptPYgp0lg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9A90280A05;
 Tue, 18 Nov 2025 17:34:28 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 296581205CC;
 Tue, 18 Nov 2025 17:34:26 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87ikf8e5jx.fsf@localhost>
Message-ID: <jwv7bvnnf6n.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN> <87o6p2geg0.fsf@localhost>
 <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
 <jwv5xb8vmka.fsf-monnier+emacs@HIDDEN>
 <jwvikf8u4ok.fsf-monnier+emacs@HIDDEN> <87ikf8e5jx.fsf@localhost>
Date: Tue, 18 Nov 2025 17:34:24 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.242 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Works in my testing.
> Also, with the original issue I reported for inline.el.

Thanks, pushed to `master`,


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 17 Nov 2025 21:03:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 17 16:03:00 2025
Received: from localhost ([127.0.0.1]:54212 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vL6NI-00005f-2G
	for submit <at> debbugs.gnu.org; Mon, 17 Nov 2025 16:03:00 -0500
Received: from mout01.posteo.de ([185.67.36.65]:42983)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vL6NE-00005J-7s
 for 68818 <at> debbugs.gnu.org; Mon, 17 Nov 2025 16:02:58 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 044DA240028
 for <68818 <at> debbugs.gnu.org>; Mon, 17 Nov 2025 22:02:49 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763413370; bh=wkBydN7A3AUxEx/RP47batbICEw/HX/pEyFTpnXu2Fc=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=folyDM55fLJdSiSQIpiImfu3dg9PRm+v84AvuHniGAGowSSjLs8T2U4zM99bm2sUg
 cH72eq5R+akbMBO277CkyiJ/VU5L199bnWIYi5LCJxJD4TPEVVzNob9+ZgxKS5d+rj
 JM5yqAVHcdcSPwr4yhnSvYy0dEvxlu8IU+ebwRMxZfw754HF/zUquZyBkOTwHmfnIS
 O+B5vj1YzWINgrthbj5pLHDQucVdlbg1Tm7433TTfBOsm8UeNG2Q8wixJTHotfdvI6
 JQIZPcaBzblS8+xZ+8TPFsHiPN4LMxyNAgetaERLBOV/0/s6R6nNBHrfMXdfeTvZDk
 OhwYJjDocfUkQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d9KvX718sz6twB;
 Mon, 17 Nov 2025 22:02:48 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvikf8u4ok.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN> <87o6p2geg0.fsf@localhost>
 <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
 <jwv5xb8vmka.fsf-monnier+emacs@HIDDEN>
 <jwvikf8u4ok.fsf-monnier+emacs@HIDDEN>
Date: Mon, 17 Nov 2025 21:02:49 +0000
Message-ID: <87ikf8e5jx.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> In any case, maybe we want something like the patch below?
>
> Or rather like the one below which doesn't immediately crash,

Works in my testing.
Also, with the original issue I reported for inline.el.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 17 Nov 2025 14:16:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 17 09:16:18 2025
Received: from localhost ([127.0.0.1]:51429 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vL01i-00034q-93
	for submit <at> debbugs.gnu.org; Mon, 17 Nov 2025 09:16:18 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40112)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vL01f-00034a-FP
 for 68818 <at> debbugs.gnu.org; Mon, 17 Nov 2025 09:16:15 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 264C7441DA2;
 Mon, 17 Nov 2025 09:16:10 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763388968;
 bh=i2C8Kex2rX3HYSt4rnx+qjCUgMKjhvo6BAYpIxonqDQ=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=b9GnokygHiicxQWuXNByLRycBYXHMcIYfGdpV7QenJ8j2V89k6Cl0GzDXphqWrCaQ
 1sTCI42A6okqBmsdfs8NmItzI9wSgqcSURmYYDrr2aLrJqrLVqdxkqm+mRVu9Wm6pd
 dMlDdsKC9iKr3XHRl/ESPM3T/n6O5iOzFSUdwhkGkAT0dzG26lbS91DVnfc/EtHsGN
 dKRqLi1PlJ4WgchzKh1wVLmKqIEzqWBn+F8CvbSMws7heT9YTd+jjmJvIqjKEqBTbL
 6VFCY0R4s5eA9nCLgK8tP04GuqLI9mU7JI7u8WyQkJxuU5Drvh8NEa+sJ98iX0iadb
 ztVcVa9Cg7OSw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5B249441D9B;
 Mon, 17 Nov 2025 09:16:08 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C16A4120387;
 Mon, 17 Nov 2025 09:16:06 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwv5xb8vmka.fsf-monnier+emacs@HIDDEN>
Message-ID: <jwvikf8u4ok.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN> <87o6p2geg0.fsf@localhost>
 <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
 <jwv5xb8vmka.fsf-monnier+emacs@HIDDEN>
Date: Mon, 17 Nov 2025 09:16:04 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.101 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

> In any case, maybe we want something like the patch below?

Or rather like the one below which doesn't immediately crash,


        Stefan

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=indent-macro.patch

diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 05ee0615fec..47bafbde03e 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -246,6 +246,12 @@ 'byte-run--set-function-type
       (list 'function-put (list 'quote f)
             ''function-type (list 'quote val))))
 
+(defalias 'byte-run--dont-autoload
+  #'(lambda (fn)
+      #'(lambda (&rest args)
+          (let ((code (apply fn args)))
+            (list 'progn ':autoload-end code)))))
+
 ;; Add any new entries to info node `(elisp)Declare Form'.
 (defvar defun-declarations-alist
   (list
@@ -368,16 +374,18 @@ 'byte-run--parse-declarations
         (cons actions cl-decls))))
 
 (defvar macro-declarations-alist
-  (cons
-   (list 'debug #'byte-run--set-debug)
-   (cons
+  (nconc
+   (list
+    (list 'debug #'byte-run--set-debug)
     ;; macros can declare (autoload-macro expand) to request expansion
     ;; during autoload generation of forms calling them.  See
     ;; `loaddefs-generate--make-autoload'.
     (list 'autoload-macro #'byte-run--set-autoload-macro)
-    (cons
-     (list 'no-font-lock-keyword #'byte-run--set-no-font-lock-keyword)
-     defun-declarations-alist)))
+    ;; Override the entry from `defun-declarations-alist', because we
+    ;; prefer to autoload the macro when trying to indent it (bug#68818).
+    (list 'indent (byte-run--dont-autoload #'byte-run--set-indent))
+    (list 'no-font-lock-keyword #'byte-run--set-no-font-lock-keyword))
+   defun-declarations-alist)
   "List associating properties of macros to their macro expansion.
 Each element of the list takes the form (PROP FUN) where FUN is a function.
 For each (PROP . VALUES) in a macro's declaration, the FUN corresponding
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 0756c0f908f..e91587b5b23 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -861,7 +861,7 @@ lisp-indent-offset
   :type '(choice (const nil) integer)
   :safe (lambda (x) (or (null x) (integerp x))))
 
-(defcustom lisp-indent-function 'lisp-indent-function
+(defcustom lisp-indent-function #'lisp-indent-function
   "A function to be called by `calculate-lisp-indent'.
 It indents the arguments of a Lisp function call.  This function
 should accept two arguments: the indent-point, and the
@@ -1256,7 +1256,7 @@ lisp-indent-function
 					(progn (forward-sexp 1) (point))))
 	    method)
 	(setq method (or (function-get (intern-soft function)
-                                       'lisp-indent-function)
+                                       'lisp-indent-function 'macro)
 			 (get (intern-soft function) 'lisp-indent-hook)))
 	(cond ((or (eq method 'defun)
                    ;; Check whether we are in flet-like form.

--=-=-=--





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 17 Nov 2025 13:12:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 17 08:12:14 2025
Received: from localhost ([127.0.0.1]:51234 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKz1i-00080F-AM
	for submit <at> debbugs.gnu.org; Mon, 17 Nov 2025 08:12:14 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:21718)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vKz1f-0007zw-VB
 for 68818 <at> debbugs.gnu.org; Mon, 17 Nov 2025 08:12:12 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E5D0C100383;
 Mon, 17 Nov 2025 08:12:05 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763385124;
 bh=vhgXYxl4BSkuigEMRkBrX6l99v1WxnDpqt3VCjT/kKI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=F+cFLLceaNWQxQoFEE2MPw6gwC838KOUBAhMO+KfZOZk91lRJ9xGpiaHgHePNTiWj
 PjTXGxue2Kaya5C1AqgcI/vL4SpCE9ukynMnrKIyhoCr9Jct8REgPf3j6hW8b8F0jp
 paBWxjjDPa2YUzfirPvnhLEsC3UFXgFET9Hfc9q+VVKP8xYn+6odbrA4j34sg9gy2b
 gbgmINjOlX/ytPoTD7xeywdcOEXekIuVSdHVvbhogFX+qwu7C8q8hviw0T14g4hiek
 gGWNMOENLa5nUQLcqxb4ktbbO/NXez83vX4zhWuwUZC8Ohxg5UgEhBRWIV70d2C9Oy
 c+VHKnlEnXJWQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B2422100146;
 Mon, 17 Nov 2025 08:12:04 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0C8E3120607;
 Mon, 17 Nov 2025 08:12:02 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
Message-ID: <jwv5xb8vmka.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN> <87o6p2geg0.fsf@localhost>
 <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
Date: Mon, 17 Nov 2025 08:11:59 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.142 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier [2025-11-16 19:55:10] wrote:
> Ihor Radchenko [2025-11-16 15:55:34] wrote:
>> Stefan Monnier <monnier@HIDDEN> writes:
>>>> As a consequence of the above, if we do
>>>> (function-get (intern-soft function) 'lisp-indent-function 'macro)
>>>> when function is ert-deftest, other macros from ert library will not be
>>>> loaded.
>>> Why not?  (get 'ert-deftest 'lisp-indent-function) gives nil for me, so
>>> the `function-get` would autoload `ert.el`, after which indentation
>>> seems to work fine.  What am I missing?
>> (function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
>> (autoloadp (symbol-function 'ert-deftest)) ; => still t
> That's not what I see here.
>
> [...]
>
> Hmm... apparently (get 'ert-deftest 'lisp-indent-function) returns
> 2 already at startup in Emacs-30.1, but nil in Emacs `master`.

I'm not sure what caused this change.  I suspect it's an unintended
side-effect of the "autoload-macro expand" feature, affecting macros
defined with `cl-defmacro`.

In any case, maybe we want something like the patch below?


        Stefan


diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 05ee0615fec..d0bfcc3647c 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -247,6 +247,12 @@ 'byte-run--set-function-type
             ''function-type (list 'quote val))))
 
 ;; Add any new entries to info node `(elisp)Declare Form'.
+(defalias 'byte-run--dont-autoload
+  (lambda (fn)
+    (lambda (&rest args)
+      (let ((code (apply fn args)))
+        (list 'progn ':autoload-end code)))))
+
 (defvar defun-declarations-alist
   (list
    (list 'advertised-calling-convention
@@ -375,6 +381,9 @@ macro-declarations-alist
     ;; during autoload generation of forms calling them.  See
     ;; `loaddefs-generate--make-autoload'.
     (list 'autoload-macro #'byte-run--set-autoload-macro)
+    ;; Override the entry from `defun-declarations-alist', because we
+    ;; prefer to autoload the macro when trying to indent it (bug#68818).
+    (list 'indent (byte-run--dont-autoload #'byte-run--set-indent))
     (cons
      (list 'no-font-lock-keyword #'byte-run--set-no-font-lock-keyword)
      defun-declarations-alist)))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 0756c0f908f..e91587b5b23 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -861,7 +861,7 @@ lisp-indent-offset
   :type '(choice (const nil) integer)
   :safe (lambda (x) (or (null x) (integerp x))))
 
-(defcustom lisp-indent-function 'lisp-indent-function
+(defcustom lisp-indent-function #'lisp-indent-function
   "A function to be called by `calculate-lisp-indent'.
 It indents the arguments of a Lisp function call.  This function
 should accept two arguments: the indent-point, and the
@@ -1256,7 +1256,7 @@ lisp-indent-function
 					(progn (forward-sexp 1) (point))))
 	    method)
 	(setq method (or (function-get (intern-soft function)
-                                       'lisp-indent-function)
+                                       'lisp-indent-function 'macro)
 			 (get (intern-soft function) 'lisp-indent-hook)))
 	(cond ((or (eq method 'defun)
                    ;; Check whether we are in flet-like form.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 17 Nov 2025 00:55:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 19:55:27 2025
Received: from localhost ([127.0.0.1]:47676 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKnWg-0004VW-No
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 19:55:27 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2738)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vKnWd-0004VE-Tb
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 19:55:24 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A96B21002F0;
 Sun, 16 Nov 2025 19:55:17 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763340916;
 bh=CSI0BADKa2jvvRbNnGtBYypPqZBqzNTDePlPoonIFdc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=n0HaXFFwRou/Jcjcj/RLTZ5GXKpDJ9a4pxhz9VRBAnuqhXvOdodUGfbgBp27x8/re
 fZdXqlQq63XkjSSqKFiPY5OEByEQ+Usur0XS7Voa9gbgzS3hCMvkCZODXskt140cBV
 xCnr8D/P1mZ4Q0AT2v7qaG5SAqNaQ2LX0uKhWus46QTdOevxggbDBkGdLwL+bagFd/
 L0uwxtBTWS+OauLLK3lYpoI7+lF+gneapmnXhbDs8QQp49XU2w520lt6uMt3Vm0KNd
 MEx3/efEVqoyytME2ShbYKFmYFa0JFmguiqTrjidwZhBKuVhzkGbz4ollt9oRIIdA1
 lRwscs7VOLaRg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2466B10013E;
 Sun, 16 Nov 2025 19:55:16 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 73A5E120728;
 Sun, 16 Nov 2025 19:55:14 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87o6p2geg0.fsf@localhost>
Message-ID: <jwv346dwknv.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN> <87o6p2geg0.fsf@localhost>
Date: Sun, 16 Nov 2025 19:55:10 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.142 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ihor Radchenko [2025-11-16 15:55:34] wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
>>> As a consequence of the above, if we do
>>> (function-get (intern-soft function) 'lisp-indent-function 'macro)
>>> when function is ert-deftest, other macros from ert library will not be
>>> loaded.
>> Why not?  (get 'ert-deftest 'lisp-indent-function) gives nil for me, so
>> the `function-get` would autoload `ert.el`, after which indentation
>> seems to work fine.  What am I missing?
> (function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
> (autoloadp (symbol-function 'ert-deftest)) ; => still t

That's not what I see here.

[...]

Hmm... apparently (get 'ert-deftest 'lisp-indent-function) returns
2 already at startup in Emacs-30.1, but nil in Emacs `master`.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 16 Nov 2025 15:55:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 10:55:43 2025
Received: from localhost ([127.0.0.1]:45858 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKf6N-0001al-9L
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:55:43 -0500
Received: from mout01.posteo.de ([185.67.36.65]:37991)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKf6L-0001aW-0l
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:55:41 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id CA8D8240027
 for <68818 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 16:55:34 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763308534; bh=lYHjhZefP8S964bl6JBBEuYjBud6dw2ybzHTn9xyvG0=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=KSwLt5W2KnK3IG/n6qdRRCncfgvryCh5naJZkY+j5fQ0pLKlyobUJ31bK8IXguwoB
 f2+ADabThLTxHi94OiHHIlxf7Zu46S1NqVxHir9mcvJzH3y7qkDnVieJVYLsxv1PXS
 cQuIgBmBMlHw+I0hHWSrNXn4v37EmlngIseLFoeEL6LltoQAAc3QjkVgR+GknG6xob
 zPsncTqeWC/tj+rV5j3XD6OzUObnoQw6QDBMv93mZEnnLwjHg+OXvZ+NanTqJGafk2
 zphYjPc1SOlz8+0up2WDI9nhnbjRa62ejmS57lgmuPJi2RvIjuLFxB4BNJoux/5BvU
 6pNuqVXIOzyZw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8b7T6P6wz9rxD;
 Sun, 16 Nov 2025 16:55:33 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
 <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN>
Date: Sun, 16 Nov 2025 15:55:34 +0000
Message-ID: <87o6p2geg0.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> As a consequence of the above, if we do
>> (function-get (intern-soft function) 'lisp-indent-function 'macro)
>> when function is ert-deftest, other macros from ert library will not be
>> loaded.
>
> Why not?  (get 'ert-deftest 'lisp-indent-function) gives nil for me, so
> the `function-get` would autoload `ert.el`, after which indentation
> seems to work fine.  What am I missing?

(function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
(autoloadp (symbol-function 'ert-deftest)) ; => still t

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 16 Nov 2025 15:34:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 10:34:45 2025
Received: from localhost ([127.0.0.1]:45784 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKem4-0000Td-NA
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:34:45 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22675)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vKem2-0000TO-Rd
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:34:43 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C2D851002F0;
 Sun, 16 Nov 2025 10:34:36 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763307275;
 bh=uVmi56aiyBr+9sc1wzHeJp67DCPH5D74oawcAv+8Sbw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=TWlgGVfbrkciSFDkGEDy586TsqEVnbXcfTJ0vigE1k8P2vrTXmbdI0OSf4CSSc7mI
 M4CV9rJtrq7J4X3phlpm55Jp48+0czla0A1ncJK1KAOYYbrUdVryGmflpGs4R3Thnl
 2zx/MF0W5s/n/fI+zfLPLapPOGkmnjgLkBjNH/01v4wBm7bF+zkFkbSt1uy1Sbucv6
 iGsj/Szg0gbSHVN1R+RAFH7w/vJUyHntKtcWQDDPIRouZ7Izgofu3rcfhffpMKFtnV
 tVYPqmZJOpX4dDlDJIOKbZYgFwUvDmE1ffQu2BGWwZwtVE28WzkY0VSbs8vjlyaJYg
 wSrXdPxOyfMEg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CC26110013E;
 Sun, 16 Nov 2025 10:34:35 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 058251203C3;
 Sun, 16 Nov 2025 10:34:33 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87zf8mgi1u.fsf@localhost>
Message-ID: <jwvo6p2vvqs.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN> <87zf8mgi1u.fsf@localhost>
Date: Sun, 16 Nov 2025 10:34:30 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.143 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> As a consequence of the above, if we do
> (function-get (intern-soft function) 'lisp-indent-function 'macro)
> when function is ert-deftest, other macros from ert library will not be
> loaded.

Why not?  (get 'ert-deftest 'lisp-indent-function) gives nil for me, so
the `function-get` would autoload `ert.el`, after which indentation
seems to work fine.  What am I missing?


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 16 Nov 2025 14:37:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 09:37:51 2025
Received: from localhost ([127.0.0.1]:45246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKdt0-00039Q-A8
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:37:50 -0500
Received: from mout01.posteo.de ([185.67.36.65]:49789)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKdsx-00038q-Cx
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:37:48 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 7230A240028
 for <68818 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 15:37:41 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763303861; bh=KGMnJ12xMSkEqCCYe4hH4zSgGhFoH44yi/8uYrEfp1k=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=NUML92bH+pBFx8q0pDzY9jfZ8GZKDov4ILjjqhneAfarFWC+prZ4uNYKj6Ykvicxn
 JIdQml2YN3KBxIiBWOconvhKt29+wgtcP1gHtLzFAfgWGzePrOW5DYjnJ6TaepsXY9
 /Ge0iq0PsENXi5BsN2leX/pb2ALacrg4py2ZD7NYtQ5Ty+FK6V7e8bF+mqg1VWuydL
 pU5a9mfUHWF1QfdoQcvcczR+q624VnoXasMoYD8OaegXD/g+qQ1FebkTM7Ffm3JDV+
 zGAW9nd8A2Ajsd110ZpVLoE1agt+2uPc2FDVcwcurpnoO1vzVHeQKqLpaS5k2t34rr
 sQUu0W2kI7nEA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8YPc6qR3z6txy;
 Sun, 16 Nov 2025 15:37:40 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvfraexfdn.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
 <jwvfraexfdn.fsf-monnier+emacs@HIDDEN>
Date: Sun, 16 Nov 2025 14:37:41 +0000
Message-ID: <87zf8mgi1u.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> (autoloadp (symbol-function 'ert-deftest)) ; => t
>> (function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
>> (autoloadp (symbol-function 'ert-deftest)) ; => t (still t; nothing got autoloaded)
>> (function-get 'ert-deftest 'i-do-not-exist 'macro) ; => nil
>> (autoloadp (symbol-function 'ert-deftest)) ; => nil (`function-get' only
>> does autoloading when it cannot find property inside autoload object itself)
>
> OK, then what I didn't understand is why you think that's a problem?
> ...
> AFAICT, if we add `macro` to `function-get` we'll get the same behavior
> except that it will not autoload when `lisp-indent-function` is
> already set.
>
> Why do we want to autoload when `lisp-indent-function` is already set?

As a consequence of the above, if we do
(function-get (intern-soft function) 'lisp-indent-function 'macro)
when function is ert-deftest, other macros from ert library will not be
loaded.

Recall your earlier message:

>>> Maybe we could start with a simpler case: indentation inside
>>> `ert-deftest` is currently broken if `ert.el` is not yet loaded.
>>> Yet Emacs already knows that it's an (autoloaded) macro, so it clearly
>>> can DTRT here by (auto)loading the file when indenting something
>>> relative to it.

What you asked will not happen when we simply try to pass 'macro to
function-get. AFAIU, there is no problem with indentation rules for
ert-deftest itself. The problem is that indentation is wrong for all
other macros (not autoloaded) in ert.el.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 16 Nov 2025 13:46:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 08:46:35 2025
Received: from localhost ([127.0.0.1]:44845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKd5P-0000rY-Ag
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 08:46:35 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52949)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vKd5N-0000rJ-B5
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 08:46:33 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ACEFF1002F0;
 Sun, 16 Nov 2025 08:46:27 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763300786;
 bh=jzXvPyaUgwJ1bZlT9tYJz2Q54bapk4CNbztWyauVjVc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=IcOy/N4LqtLGLERLMnT/6pHPO/1MsJse8AhD64tRoAhzp/eWQ75Mi9U6u/2B9I1TF
 qgD+D0T4Kt67TVGY57fhwNDbHA0ZaYO5SRUJesVzAk14c0JwYZKT6FnnZ36zj2l/K7
 UDfLDS2f0Uj8ggX0EpkQCmlC+ovV7tSr23G1kJMTzqhnyO+Fo6NpxGr00PhGME9VMB
 Ui/XZHPUvCs6f0re47Lsh5lwUhwh8GfQER7FkPj9sRxzrB0QCUuNZxDCt0YPzDKHRd
 ntysNbwL4osG0re+JOlVbXn0f2hzZn+RIR3/co685UA6KebyUXP/Nv4JkA+s2MgdmV
 TLC3Azxnz4niQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9C54410013E;
 Sun, 16 Nov 2025 08:46:26 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E550A1202D3;
 Sun, 16 Nov 2025 08:46:24 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87pl9jdlyo.fsf@localhost>
Message-ID: <jwvfraexfdn.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
Date: Sun, 16 Nov 2025 08:46:18 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.123 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ihor Radchenko [2025-11-15 21:29:12] wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
>>> (but not really, as it does not trigger autoloading when symbol
>>> already has the requested property).
>> Sorry, I don't understand what you tried to say here.
>> Did you maybe write one "not" too many?
>
> (autoloadp (symbol-function 'ert-deftest)) ; => t
> (function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
> (autoloadp (symbol-function 'ert-deftest)) ; => t (still t; nothing got autoloaded)
> (function-get 'ert-deftest 'i-do-not-exist 'macro) ; => nil
> (autoloadp (symbol-function 'ert-deftest)) ; => nil (`function-get' only
> does autoloading when it cannot find property inside autoload object itself)

OK, then what I didn't understand is why you think that's a problem?

> --- a/lisp/emacs-lisp/lisp-mode.el
> +++ b/lisp/emacs-lisp/lisp-mode.el
> @@ -1253,6 +1253,9 @@ lisp-indent-function
>        (let ((function (buffer-substring (point)
>  					(progn (forward-sexp 1) (point))))
>  	    method)
> +        ;; When FUNCTION is autoloaded macro, trigger autoloading
> +        ;; the whole containing library.  See bug#68818.
> +        (autoload-do-load (indirect-function (intern-soft function)) 'macro)
>  	(setq method (or (function-get (intern-soft function)
>                                         'lisp-indent-function)
>  			 (get (intern-soft function) 'lisp-indent-hook)))

AFAICT, if we add `macro` to `function-get` we'll get the same behavior
except that it will not autoload when `lisp-indent-function` is
already set.

Why do we want to autoload when `lisp-indent-function` is already set?


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 16 Nov 2025 12:59:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 07:59:24 2025
Received: from localhost ([127.0.0.1]:44417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKcLj-0007HZ-R1
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 07:59:24 -0500
Received: from mout02.posteo.de ([185.67.36.66]:43067)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKcLg-0007HO-TG
 for 68818 <at> debbugs.gnu.org; Sun, 16 Nov 2025 07:59:21 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 80AFD240101
 for <68818 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 13:59:14 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763297954; bh=nuO6rxWFv39Z48xPYdIGX38H/kW8LLP7xrzJGI/L3go=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=Pd6fhQmo5hUH9Kp46mz7tvlKlURA8kp6eo4NBntGw0EMuvKVNwSnxgs/RDABEFZtI
 +Lz0C5hgmRg8NMqPeOYyHXGEU78+fjXU6u/7oNBnYJNELXx7y2wY9suuC+vNaRloe3
 IfS9z3E8deONlJHsVX+nqDMuN+wb02S78fXD1q6LDHDBlobmJmQmJQRNIfgJ6+cuvr
 aQ+m/GY2QCnpGb33ll1l4CM/O2Tl63ZHdcIaUYROgcrMRRzsfAJyXMPOFr3RIJY7Wo
 YCVDB0xwB2Vr1TlBvuOYYlYwHVAzYkC54cyAW/hEWXRcBNGKyyFKTMY6VqEAeNed5p
 taSf64td1MsCQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8WD16Qbtz6tx0;
 Sun, 16 Nov 2025 13:59:13 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87pl9jdlyo.fsf@localhost>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN> <87pl9jdlyo.fsf@localhost>
Date: Sun, 16 Nov 2025 12:59:14 +0000
Message-ID: <878qg6i16d.fsf@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Ihor Radchenko <yantar92@HIDDEN> writes:

>> You mean like `indirect-function`?
>
> Yeah. Obviously, you are right.

See the attached patch.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-lisp-mode-Autoload-macros-before-processing-their-in.patch

From 14f4251aecfe6591018b0371eb3f194f2c6a62cd Mon Sep 17 00:00:00 2001
Message-ID: <14f4251aecfe6591018b0371eb3f194f2c6a62cd.1763297871.git.yantar92@HIDDEN>
From: Ihor Radchenko <yantar92@HIDDEN>
Date: Sun, 16 Nov 2025 13:50:34 +0100
Subject: [PATCH] lisp-mode: Autoload macros before processing their
 indentation (bug#68818)

* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): When indenting a
macro, autoload it.  This will make sure that all other macros in the
same library will also be autoloaded, making their indentation rules
active.

Other macros may or may not be necessary, strictly speaking,
but autoloading them is a useful heuristics.
---
 lisp/emacs-lisp/lisp-mode.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index e4dfc7c2f78..8cc960c6c47 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1253,6 +1253,9 @@ lisp-indent-function
       (let ((function (buffer-substring (point)
 					(progn (forward-sexp 1) (point))))
 	    method)
+        ;; When FUNCTION is autoloaded macro, trigger autoloading
+        ;; the whole containing library.  See bug#68818.
+        (autoload-do-load (indirect-function (intern-soft function)) 'macro)
 	(setq method (or (function-get (intern-soft function)
                                        'lisp-indent-function)
 			 (get (intern-soft function) 'lisp-indent-hook)))
-- 
2.50.1


--=-=-=
Content-Type: text/plain


-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 15 Nov 2025 21:29:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 15 16:29:24 2025
Received: from localhost ([127.0.0.1]:37645 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKNpj-0008Cj-OU
	for submit <at> debbugs.gnu.org; Sat, 15 Nov 2025 16:29:24 -0500
Received: from mout01.posteo.de ([185.67.36.65]:54207)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKNpg-0008CV-80
 for 68818 <at> debbugs.gnu.org; Sat, 15 Nov 2025 16:29:21 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id B2C83240027
 for <68818 <at> debbugs.gnu.org>; Sat, 15 Nov 2025 22:29:12 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763242152; bh=03Vm7+hVmTQjpPFcaYvUC4yDjbCRoBAzo82vpuuT6MQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=j7615bGm70dpT5tcp74clOUGOboyE84ilshA0Xbrz0+pbk/xQequfzV4GmErOcHna
 qm0i/hQdD/NDU4aItLL5vI2CAIakQtCqm5WEjDDkk7Epcm1LtH/8vMI+bAbniFx4f9
 YRZfZNFQSwWSUh7RacgCPiEJYwq6hBO3hWYhwz8gM7POtoWFcoUe1y/zSs3eDZbJgF
 Z6Sbb9RTpF5T6T8H09lfmRJpI22iQCCpY7MTrkcwjkjld1PI/HWO8ktXJIFg6dndrN
 veKo9vYhX9UHJmd8AvC6k7RafKiYjYktk4rdha7WVgtATKxn+gO/ay1bAxl+JSfCKE
 xPTB9bN8ZDzhQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d86Zv2fGXz6tw4;
 Sat, 15 Nov 2025 22:29:11 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvh5v2f503.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
 <jwvh5v2f503.fsf-monnier+emacs@HIDDEN>
Date: Sat, 15 Nov 2025 21:29:12 +0000
Message-ID: <87pl9jdlyo.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> (but not really, as it does not trigger autoloading when symbol
>> already has the requested property).
>
> Sorry, I don't understand what you tried to say here.
> Did you maybe write one "not" too many?

(autoloadp (symbol-function 'ert-deftest)) ; => t
(function-get 'ert-deftest 'lisp-indent-function 'macro) ; => 2
(autoloadp (symbol-function 'ert-deftest)) ; => t (still t; nothing got autoloaded)
(function-get 'ert-deftest 'i-do-not-exist 'macro) ; => nil
(autoloadp (symbol-function 'ert-deftest)) ; => nil (`function-get' only does autoloading when it cannot find property inside autoload object itself)

>> Maybe resolving function indirection should be exposed as auxiliary
>> function for all Elisp programs?
>
> You mean like `indirect-function`?

Yeah. Obviously, you are right.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 10 Nov 2025 12:29:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 10 07:29:35 2025
Received: from localhost ([127.0.0.1]:37626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vIR1b-0008Pc-1u
	for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 07:29:35 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50825)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vIR1Y-0008PS-JN
 for 68818 <at> debbugs.gnu.org; Mon, 10 Nov 2025 07:29:33 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CB76D441631;
 Mon, 10 Nov 2025 07:29:26 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1762777765;
 bh=3Qvz/D8y0q61Gi+j1j9eo0p0xwh/23MxdoT3yldvFF0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=H9pTmhmjMd7GHj1U7XdmA035MSadu/OrYNJdeR/XwaXJ06aPKUsncqLbJtmjN3dkT
 737EvcGJLfrYLz3zL0x6zb3+byKVCjdG3SJVB0Rn7fu0RUPqimofTODtMam4RwRSKL
 jetTVR4qPGQxnV8vs5YP7LoLnCQmF24aDFC7gFq4IYOzsDPOXRrORCVZTRvbB6wEk/
 RVHkVskrz4SBVqNvuPIDrZg/8KFFa7z4BF55/qyoQv/Y01Q9AklRUvO4dCHGp0Z/JR
 ldZmgzIVah1yN45obJ9YBeQo2raKgaHUe0JmcCmLR/Q0yFKOvgGdJjGK2ueySuTrzW
 Ez8kKxpdXBCZQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C5B36440310;
 Mon, 10 Nov 2025 07:29:25 -0500 (EST)
Received: from asado (unknown [179.49.125.171])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3A7011203B5;
 Mon, 10 Nov 2025 07:29:24 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87a50wh6mz.fsf@localhost>
Message-ID: <jwvh5v2f503.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN> <87a50wh6mz.fsf@localhost>
Date: Mon, 10 Nov 2025 07:29:20 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> This will be something like the attached.
> However, I am not sure if manually resolving function indirection is the
> right approach. I copied it from `function-get', which almost does what
> we need as is with AUTOLOAD='macro

Oh, indeed we should use `function-get`.

> (but not really, as it does not trigger autoloading when symbol
> already has the requested property).

Sorry, I don't understand what you tried to say here.
Did you maybe write one "not" too many?

> Maybe resolving function indirection should be exposed as auxiliary
> function for all Elisp programs?

You mean like `indirect-function`?


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 8 Nov 2025 15:44:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 08 10:44:06 2025
Received: from localhost ([127.0.0.1]:52121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vHl6j-0008NB-RV
	for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 10:44:06 -0500
Received: from mout02.posteo.de ([185.67.36.66]:52205)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vHl6g-0008ML-H4
 for 68818 <at> debbugs.gnu.org; Sat, 08 Nov 2025 10:44:03 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D6FCA240101
 for <68818 <at> debbugs.gnu.org>; Sat,  8 Nov 2025 16:43:55 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1762616635; bh=tOF5DX6CUwT9gCbKMeo9cFHeuxLTbSdaR/Amh9mmqrk=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=Sy+OeJdp3E7OnqtzmD9MonOzYBf2E0OolDq5Nb7/+/sOP5R4UmjZnLTn97lZIwnhA
 7upJU0HVlhQKtXAGKg6hhSeUWCOUTCQEn788R/Xf5pbTKoh+J9WPubklGXhTJ/xMOS
 yHJRbBZbNpeIK2QEqG7moxT4MXTeKyRX60wzwcT2UY5huPAHcW7LwElVcEBDjgUL4I
 4EFXLDOE7mXbCgqpPfFDvMedPyOL+t4kgscJzNcj9ILOsdcvP4mG8r/M1DO+Jp6f12
 N10Qwgr/ZtiJB/qozm8oVXC2UGmkvpImbcNFKCw18vNyQGc8+z70rqPaCYlaKKGp8v
 my+wuZ27svwLw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d3gFk6hPrz6v0F;
 Sat,  8 Nov 2025 16:43:54 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
 <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN>
Date: Sat, 08 Nov 2025 15:43:55 +0000
Message-ID: <87a50wh6mz.fsf@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Stefan Monnier <monnier@HIDDEN> writes:

>>> Should it be `lisp-indent-function'?
>
> I think that would be the place, yes.
> Maybe we could start with a simpler case: indentation inside
> `ert-deftest` is currently broken if `ert.el` is not yet loaded.
> Yet Emacs already knows that it's an (autoloaded) macro, so it clearly
> can DTRT here by (auto)loading the file when indenting something
> relative to it.

This will be something like the attached.
However, I am not sure if manually resolving function indirection is the
right approach. I copied it from `function-get', which almost does what
we need as is with AUTOLOAD='macro (but not really, as it does not
trigger autoloading when symbol already has the requested property).

Maybe resolving function indirection should be exposed as auxiliary
function for all Elisp programs?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=tentative.diff

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index e4dfc7c2f78..2b975b340b5 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1253,6 +1253,17 @@ lisp-indent-function
       (let ((function (buffer-substring (point)
 					(progn (forward-sexp 1) (point))))
 	    method)
+        ;; When FUNCTION is autoloaded macro, trigger autoloading
+        ;; the whole containing library.  See bug#68818.
+        (let ((f (intern-soft function)))
+          (when (macrop f)
+            (while (and (symbolp f) (fboundp f))
+              (let ((fundef (symbol-function f)))
+                (if (and (autoloadp fundef)
+                         (not (equal fundef (autoload-do-load fundef f 'macro))))
+                    nil ; done
+                  ;; resolve alises further
+                  (setq f fundef))))))
 	(setq method (or (function-get (intern-soft function)
                                        'lisp-indent-function)
 			 (get (intern-soft function) 'lisp-indent-hook)))

--=-=-=
Content-Type: text/plain


-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 24 Jun 2025 20:55:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 24 16:55:17 2025
Received: from localhost ([127.0.0.1]:50626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uUAfl-0001MH-3c
	for submit <at> debbugs.gnu.org; Tue, 24 Jun 2025 16:55:17 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13794)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1uUAfj-0001Ju-Cl
 for 68818 <at> debbugs.gnu.org; Tue, 24 Jun 2025 16:55:15 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 05E901000BC;
 Tue, 24 Jun 2025 16:55:10 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1750798509;
 bh=VybHs0AhHwKixfu9k56JcxxE5dI24ZGaj0OPLZS05g0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=bEmLBnw+CFrRX8JMHfB4MiXqMZYIc3dbciIjHJLi156ActGgxTctAhAJF/RGrfTm8
 s2oYADrOZSu5AApN4Yg/YsRmO3vojQ4F7oIPOpDCNE5xS+Et1u89K6A1yM0mku3Z34
 N08SpIpA3SKNcc3nsSRp5/fas147046OY4FgTzg1G7NbGcTbegqHt9h2c6tMWc/nkK
 +DMHHs91dwVKsmJY+dA+tqQNoaPBd7wXrx7cpWQ7IDaNUEkn0kfae0C8OxQrdrcSpR
 iaYfXITwVfnplcraOksDUnxSStVbG3I6glUf1h/Op6KhW0QOKsp+9/WyRGiC0wWnew
 msHuFmZpd3S7w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0D01A100029;
 Tue, 24 Jun 2025 16:55:09 -0400 (EDT)
Received: from pastel (unknown [104.247.225.139])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D1F9B12008F;
 Tue, 24 Jun 2025 16:55:08 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87cybevaau.fsf@localhost>
Message-ID: <jwv1pr8vp6y.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost> <87cybevaau.fsf@localhost>
Date: Tue, 24 Jun 2025 16:55:08 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.315 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>>> Did you make any progress here?  Does it still make sense to keep this
>>> bug report open?  Thanks in advance.
>> Did you expect me to update Elisp indentation code?
>> If yes, I am not really sure where I should do it.
>> Should it be `lisp-indent-function'?
> Ping!

I think that would be the place, yes.
Maybe we could start with a simpler case: indentation inside
`ert-deftest` is currently broken if `ert.el` is not yet loaded.
Yet Emacs already knows that it's an (autoloaded) macro, so it clearly
can DTRT here by (auto)loading the file when indenting something
relative to it.

For `inline-letevals` the situation is a bit more complicated because
the indentation code first needs to see that we're inside
a `define-inline`, but hopefully the above will be a good first step to
tackle the more complex case.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 8 Jun 2025 09:44:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 08 05:44:15 2025
Received: from localhost ([127.0.0.1]:50738 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uOCZa-0003uw-Vv
	for submit <at> debbugs.gnu.org; Sun, 08 Jun 2025 05:44:15 -0400
Received: from mout01.posteo.de ([185.67.36.65]:40989)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1uOCZY-0003ug-9S
 for 68818 <at> debbugs.gnu.org; Sun, 08 Jun 2025 05:44:13 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 4921B240028
 for <68818 <at> debbugs.gnu.org>; Sun,  8 Jun 2025 11:44:06 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net;
 s=1984.ea087b; t=1749375846;
 bh=srQEZYneDc4O/EpfbbcdxvNf/qy+yZqVNS4TtRWVQJw=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=EhZvmiqCWETzQttzjICFeRqN6RZutF2ppX26a+y4uetjbrLn4TiL/jLHQesCPGKAE
 RMQqoDV/DaSgw0GiiOYxXyAYw0s0ZDwpUZAduEUNcSygC2cgeX4eezfb3iLgULhwb/
 pI/NbC6dhg6wRsB8YzLaODjbE7b/dMrr1QrUGXaVZ8rdoL5z+TiYO24kdEDY/jHGtZ
 NuqOr2VRXnYVvicShCZ1m4Ajp1e/hd0vEx53A9GQsmPfALL24s9SGQjHjo7Hfx6pk2
 R8uGSBXmFyUCRfwSu1Sfm4z7FZv9pLpreGv1XO6WOju7uzzQnBEk0QXXuZwblUUJDB
 Zl4rhboe1bIqUcmQ8RgTRYPybke/kLkIf38cA0tLUCdqb8/RQ95KODTJi2E9RNHzN0
 QloH1Z8i4gSudMODV0KjtJWYiANx6NOYuBcPzH1DWnLlAEHnucYZqRrWYq2/PaWpS3
 qCFPCUldRvkdkO92T86bhwcKdI8yBLnYeD0ZeZQawOyl2GTq2w8
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4bFVW92jFZz9rxF;
 Sun,  8 Jun 2025 11:44:05 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87bjut6ldh.fsf@localhost>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
 <87bjut6ldh.fsf@localhost>
Date: Sun, 08 Jun 2025 09:42:49 +0000
Message-ID: <87cybevaau.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ihor Radchenko <yantar92@HIDDEN> writes:
>> Did you make any progress here?  Does it still make sense to keep this
>> bug report open?  Thanks in advance.
>
> Did you expect me to update Elisp indentation code?
> If yes, I am not really sure where I should do it.
> Should it be `lisp-indent-function'?

Ping!

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 23 Feb 2025 09:50:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 23 04:50:43 2025
Received: from localhost ([127.0.0.1]:59349 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm8dG-00015z-TM
	for submit <at> debbugs.gnu.org; Sun, 23 Feb 2025 04:50:43 -0500
Received: from mout02.posteo.de ([185.67.36.66]:57101)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1tm8dD-00015c-38
 for 68818 <at> debbugs.gnu.org; Sun, 23 Feb 2025 04:50:40 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 7FA67240101
 for <68818 <at> debbugs.gnu.org>; Sun, 23 Feb 2025 10:50:31 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1740304231; bh=jx8nhwTdYhkyu97s/fXpFGgd1nwxRjODJpZCgKAvBDk=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=KOh9TURE2cZTnT4arO2C1RcJXEp775LZz2OZHGfQI8x8wt9wY/yqjDxpdGEYgL9Ab
 8dx/CcMQ7RC7rYWYK02aayPDifpNbJZL+pi1LKnHmPm+o6WdBAEhg418ZNX6nkPfl9
 ZAVaym+zm8fxHxMt+J+Xm6Tczm8fj37pFje5dxXkIigxSLVu3yqtWjQCCwaH1JxVVM
 YUmz3Js04EC4YHceDF0sU8drm0JAfSNEEXHmkP7x6MeYbrNI/DBDDGNKn0HISck2o7
 iK7ddSJuxhyUK+KUy8r2Obw0jvnNpOw4CTy1eKaDHEY1cImQS17GUQDQPaXiwtTsHD
 YijzshZZUThjQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Z0zd24XhXz6trs;
 Sun, 23 Feb 2025 10:50:30 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
 <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
Date: Sun, 23 Feb 2025 09:50:02 +0000
Message-ID: <87bjut6ldh.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Kangas <stefankangas@HIDDEN> writes:

>>> The autoload of `define-inline` says that it's a macro, so I was
>>> thinking that maybe when the indentation code see `define-inline` it
>>> could `autoload-do-load`.
>>
>> That would make sense, yes.
>
> Did you make any progress here?  Does it still make sense to keep this
> bug report open?  Thanks in advance.

Did you expect me to update Elisp indentation code?
If yes, I am not really sure where I should do it.
Should it be `lisp-indent-function'?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 23 Feb 2025 01:00:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 22 20:00:34 2025
Received: from localhost ([127.0.0.1]:58101 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tm0MD-0002JE-Sv
	for submit <at> debbugs.gnu.org; Sat, 22 Feb 2025 20:00:34 -0500
Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:46558)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tm0M9-0001wT-Kt
 for 68818 <at> debbugs.gnu.org; Sat, 22 Feb 2025 20:00:31 -0500
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5e08064b4ddso4463914a12.1
 for <68818 <at> debbugs.gnu.org>; Sat, 22 Feb 2025 17:00:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740272423; x=1740877223; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=aR2IggjuPpqm8lzuJFwT/eb3Evv0RWB4HsBZErNfmpc=;
 b=jxLGUWi6LJMdhXCuO08VOEmBi+H/72wTy7vWvAHRp1CfIsqxikO/2hlIoTHRYMWWcH
 Vjhprmwty8V30l42qD5pvalhf98NABwFo6YvwN6NIPBw5IGkajaJhDejXJ8rKWYdi7oz
 KRtZeeDuZmYkJcdiiitxTygxroRJjmZIX4P+piFIYbGQxtEC+B4CwzC+yGwoHE+6hz/o
 u7ZTvI6XXl27TzAospdGrekAU0Y/k5DOAY5PpnK7VA5D+HhpMZLrQMm9L8t9rPW/c6gq
 kVeG1++sDFBr4g6KPqPBhB9+zDRVpAq8rVL7YNVomDzqiyarxQkMhx8ZbsJsQYWG2g/D
 R5Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740272423; x=1740877223;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=aR2IggjuPpqm8lzuJFwT/eb3Evv0RWB4HsBZErNfmpc=;
 b=TWycl+TVxVnDA4xnU5Kpt+hVij+STOjQ7rRrUWukyj9B+DEjaC1UFih4f/cM/NNIzC
 kvm8KSK3ABTVgR0jURfSWNBWsuZuGe7/tCXj8E0Bo3RvN7prXk38ogevfMB5sxIG1j6h
 YrYQrIP/kR4FM3IkAoz/k8hlV7WmoDTdrkb2QH6x8FARjp/VnAKcSVfcN5xjjB41VFUy
 jRDu+XsZUFOZTtGDzw3eSwzrnQfa0QFI3By7vOj+sFtGNEYw/TK4wZFaH64Y9AokowAQ
 WAJZ+isqej2fxuUioViPFKTjaan6B0PopGowAq3xbO3V3i7BoQkvW0QtTK7fFLuNAJE5
 ifBQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCX9C63RmDeisKcHlVgdS7vLiFQEjq/UvnGdHyp6RltvA9QLQHalpw/8fqRwNaXHl4+lW242Cw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yzggnupe09z4hPglwVzJ7OEwSIDAxBCOVinFDCm+RQQaUanKUTR
 ed7qUwiwzDm4md2P/57IotFDkmt/qlNPUZOajb3odH74Z5M1PRgW2CNwpHq8wDIs3a8OhpBuezE
 UKpfOIHXrxeKgyjYun1LLmF46mVM=
X-Gm-Gg: ASbGncu+2XtLYkR/1Dy8kiFVbWFBo8o6Y0tfnehVnBJG1dMU6h5eiwb73g0sqbv2y4e
 Jo8RDXp3wPV6KguZ+JwiGFLWqmyw/yxW0Qaxf3phbs/vNoyVpgS8i4GheJD+7LRwmJNYaFFkBGK
 u7lKoLt5Be
X-Google-Smtp-Source: AGHT+IER0/PWAPkBxviw3wkGFkzwOn1yXt3y0TMUjfscT4Lrki6syZRJwkovakgHvbyXtWN5uT+jrPltpLxGortbNa8=
X-Received: by 2002:a05:6402:530b:b0:5de:ce71:bacb with SMTP id
 4fb4d7f45d1cf-5e0b70f334emr6894426a12.16.1740272423264; Sat, 22 Feb 2025
 17:00:23 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 23 Feb 2025 01:00:22 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87h6iuve2f.fsf@localhost>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN> <87h6iuve2f.fsf@localhost>
MIME-Version: 1.0
Date: Sun, 23 Feb 2025 01:00:22 +0000
X-Gm-Features: AWEUYZlsltJcIAx5TnYPUOUV5fXSLu4X5d6FZwpqR1t36z8TmVFjeaJaCsrqi6c
Message-ID: <CADwFkmnJZUy+DennJnAixmaK8W2cFOmjJLh4vAOkTGj2SNHL8A@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
To: Ihor Radchenko <yantar92@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ihor Radchenko <yantar92@HIDDEN> writes:

> Stefan Monnier <monnier@HIDDEN> writes:
>
>>> But how does it know that a given (expr ...) is a macro call or a
>>> function call without loading the containing library? AFAIK, only
>>> autoloading can provide such information.
>>
>> The autoload of `define-inline` says that it's a macro, so I was
>> thinking that maybe when the indentation code see `define-inline` it
>> could `autoload-do-load`.
>
> That would make sense, yes.

Did you make any progress here?  Does it still make sense to keep this
bug report open?  Thanks in advance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 19:00:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 14:00:23 2024
Received: from localhost ([127.0.0.1]:36767 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUtLK-0002Ki-Te
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 14:00:23 -0500
Received: from mout01.posteo.de ([185.67.36.65]:51453)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rUtLJ-0002KP-Gi
 for 68818 <at> debbugs.gnu.org; Tue, 30 Jan 2024 14:00:22 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 64A4124002A
 for <68818 <at> debbugs.gnu.org>; Tue, 30 Jan 2024 20:00:06 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1706641206; bh=jNF/PCeI/NyFkVLfb7LzyueQGuVGnx9DY3/YC1G8VB8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=HIRFlIk6NXszMkPwsD4sjunT5FHMPg3QwyZrIuoHLE6iECRcdHYQcXKuVibVZf4Ev
 I6DfJYfOcl8MUL1yiQzDjNJGuwqqwo65gZyuBx59XLpydQ+eNG7Nxn4w4YmzhKzoOF
 i9QpH4HlNCBOp9tRpxAgwpxSgaoSIFIg7FQbtmLGdDJn/oKytyMsDrnSDoBXdGJC+o
 WxB7p/6uq33cPQAnW5oAf675/zIS2K8vXmVHUWj0AX8TDiAb49oQLnoC5kZXpXuQSX
 ytFIm4pv3NuhS48WVGiHgWcdQRLOb0YOMdzk14V4LWkNLpsPc1lVc9vI+4xr51bEUB
 BD7G2671GabRg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TPZH91nJYz9rxD;
 Tue, 30 Jan 2024 20:00:04 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvil3aofwj.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
 <jwvil3aofwj.fsf-monnier+emacs@HIDDEN>
Date: Tue, 30 Jan 2024 19:03:36 +0000
Message-ID: <87h6iuve2f.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> But how does it know that a given (expr ...) is a macro call or a
>> function call without loading the containing library? AFAIK, only
>> autoloading can provide such information.
>
> The autoload of `define-inline` says that it's a macro, so I was
> thinking that maybe when the indentation code see `define-inline` it
> could `autoload-do-load`.

That would make sense, yes.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 18:11:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 13:11:25 2024
Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUsZx-0000zU-G1
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 13:11:25 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:48919)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rUsZv-0000zF-5F
 for 68818 <at> debbugs.gnu.org; Tue, 30 Jan 2024 13:11:23 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 753501000DA;
 Tue, 30 Jan 2024 13:11:08 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1706638267;
 bh=DSWIRNDrSZ3Mire9V6HCfvK1hyKvE/rhzoBPwk1wPXc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Nyt4lgruIVmn01XiCumC0yrs48u2UzxQL5ix28CCw86m1XMfEEasgNdFq9a4vqtVu
 EfuaxBOkFrsFCrcQuy8lJigvH49ee+ZlTNpDf9mdetRCjUs0mtbFNPKNN417lCAELn
 4JRA7jMaf6cM3dHL9P5KmHJsEsh6QKywcO/FH8WiOvGPtXh2C+7whK6aF6bTYajiP4
 bUjzqL5wwrhNLTnzmFB5wzsQnWlelI6I4d2dNYZzIB082zRYu704XDc70NnMOWFpPc
 4u1ZvLPa7c78faq/+Ju4w5fmAxCwbPqB/OOzk2XsZrMJBVojpmzf8DdKo3bKgsXkOf
 gGvXFeFyVZU/w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4AA35100054;
 Tue, 30 Jan 2024 13:11:07 -0500 (EST)
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1702C1202CB;
 Tue, 30 Jan 2024 13:11:07 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <87sf2e23ie.fsf@localhost> (Ihor Radchenko's message of "Tue, 30
 Jan 2024 16:24:25 +0000")
Message-ID: <jwvil3aofwj.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN> <87sf2e23ie.fsf@localhost>
Date: Tue, 30 Jan 2024 13:11:06 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.142 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Thanks!
> `inline-const-val' docstring does not make it clear what happens when
> the value is not known at compile time.

Indeed, the docstring is lacking. =F0=9F=99=81
It "fails" which means that we revert to the "fallback" of not inlining.

>>>> with emacs -Q, indenting the file will yield different results with and
>>>> without executing (require 'inline).
>>>> With the patch, indentation becomes consistent.
>>> Hmm, I wonder whether there's a less heavy-handed approach to this.
>>
>> Agreed.  Also, I think this problem is not specific to `define-inline`.
>> Maybe the indentation code should try and (auto)load the macros
>> it encounters.
>
> But how does it know that a given (expr ...) is a macro call or a
> function call without loading the containing library? AFAIK, only
> autoloading can provide such information.

The autoload of `define-inline` says that it's a macro, so I was
thinking that maybe when the indentation code see `define-inline` it
could `autoload-do-load`.

> Maybe, autoloading can automatically collect information about all the
> symbols defined in each library - whether they are a
> function/variable/macro and their declare statement?

The point of an autoload object is that it's *much* cheaper than the
real thing.  So we can't add very much info to them.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 16:21:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 11:21:14 2024
Received: from localhost ([127.0.0.1]:36553 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUqrJ-0000zA-Ih
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 11:21:13 -0500
Received: from mout02.posteo.de ([185.67.36.66]:34089)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rUqrH-0000yZ-1m
 for 68818 <at> debbugs.gnu.org; Tue, 30 Jan 2024 11:21:12 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id CF9A7240103
 for <68818 <at> debbugs.gnu.org>; Tue, 30 Jan 2024 17:20:55 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1706631655; bh=PnDrdDkDPoF9w2pOqSnsGFl8d/NNPPQFVhS9dyXW61U=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=CInG9UqKdEaE7ylfHZR8Z+9weAGHodsDcpvjHKvOOBWQdU7dyFPGbcQGZLwKVzuac
 vzbL3a5ZyqeqPi5/8PF1au1hLeQpJmW/340ZhpHnrupFsSx+1kNyZefwOj9TlZPB5K
 L1u6gd0AYRgn+QGCZO9Slr3R7PV2mKrIIZlKJx5szBr+qAFDfVxh3LwimCW1tnNS4k
 jEVK/v3HvbPCBCLGEgByggxxvBwipKO16YdzFNHXvtC8YN6329dgleYQtUE8uWmyzi
 Ms75HCkdbUcVpD/RXwzJWe1ipf8W44JAD+eIyI09Q9t0Dn4QCCiqy1n0/hesjhb9p+
 +wSzMadCjaQKw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TPVlV2ZPNz9rxR;
 Tue, 30 Jan 2024 17:20:53 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
 <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN>
Date: Tue, 30 Jan 2024 16:24:25 +0000
Message-ID: <87sf2e23ie.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Eli Zaretskii <eliz@HIDDEN>, 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> [ Side note: IIRC the above can be simplified as:
>
>     (define-inline org-element-type-p (node types)
>       "Return non-nil when NODE type is one of TYPES.
>     TYPES can be a type symbol or a list of symbols."
>       (inline-letevals (node types)
>         (if (listp (inline-const-val types))
>             (inline-quote (memq (org-element-type ,node t) ,types))
>           (inline-quote (eq (org-element-type ,node t) ,types)))))

Thanks!
`inline-const-val' docstring does not make it clear what happens when
the value is not known at compile time.

>>> with emacs -Q, indenting the file will yield different results with and
>>> without executing (require 'inline).
>>> With the patch, indentation becomes consistent.
>> Hmm, I wonder whether there's a less heavy-handed approach to this.
>
> Agreed.  Also, I think this problem is not specific to `define-inline`.
> Maybe the indentation code should try and (auto)load the macros
> it encounters.

But how does it know that a given (expr ...) is a macro call or a
function call without loading the containing library? AFAIK, only
autoloading can provide such information.

Maybe, autoloading can automatically collect information about all the
symbols defined in each library - whether they are a
function/variable/macro and their declare statement?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 14:30:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 09:30:56 2024
Received: from localhost ([127.0.0.1]:34720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUp8Z-0005lg-GP
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 09:30:55 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rUp8X-0005lR-VM
 for 68818 <at> debbugs.gnu.org; Tue, 30 Jan 2024 09:30:54 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8CA3A4412EA;
 Tue, 30 Jan 2024 09:30:38 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1706625037;
 bh=Y/KuTSZsMxYIvydyxDjgts1dWapbFxVztGA2gHQ/O1E=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=W35JKyw4mBAxgTCCdfo12xoP26+6s27g0FnH/xc42oBHjh2AgyBKSII8IZ39TCLeO
 xmGBTSKKVC8Gkt9ToEEFfQ69cJ0nJiw2hny4ab0kJ62238iKrqyqSLjWqIzKDZW45N
 rluCBWfPhiQAaq2leKBo9k8CrUig2GGlwvSczMNKh6b92hWexw+nhWDUqW3FvjcF7+
 g5GNoE7Dj08CGoKKKWSU7TMCHa+prR9sUDDo7g5DPWdZ10lBSW0iEJoQ9i643gefPf
 KPw0BluvX3B/Q3fcgFfmyhQ6l/o0EDoral6O0dd2/VEnhVqTpRZxytVRmjQCLbb4AM
 NPu6TOrBF78/w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 228054412DF;
 Tue, 30 Jan 2024 09:30:37 -0500 (EST)
Received: from pastel (104-222-119-131.cpe.teksavvy.com [104.222.119.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E6E291204F5;
 Tue, 30 Jan 2024 09:30:36 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
In-Reply-To: <86cyti3ob3.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 30 Jan
 2024 16:09:52 +0200")
Message-ID: <jwvsf2eaof4.fsf-monnier+emacs@HIDDEN>
References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@HIDDEN>
Date: Tue, 30 Jan 2024 09:30:36 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.221 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: Ihor Radchenko <yantar92@HIDDEN>, 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> This patch solves annoying problem with `define-inline' forms not being
>> indented correctly unless inline.el is explicitly loaded.
>> 
>> For illustration, try to open the following foo.el file:
>> 
>> (define-inline org-element-type-p (node types)
>>   "Return non-nil when NODE type is one of TYPES.
>> TYPES can be a type symbol or a list of symbols."
>>   (if (inline-const-p types)
>>       (if (listp (inline-const-val types))
>>           (inline-quote (memq (org-element-type ,node t) ,types))
>>         (inline-quote (eq (org-element-type ,node t) ,types)))
>>     (inline-letevals (node types)
>>       (inline-quote
>>        (if (listp ,types)
>>            (memq (org-element-type ,node t) ,types)
>>          (eq (org-element-type ,node t) ,types))))))

[ Side note: IIRC the above can be simplified as:

    (define-inline org-element-type-p (node types)
      "Return non-nil when NODE type is one of TYPES.
    TYPES can be a type symbol or a list of symbols."
      (inline-letevals (node types)
        (if (listp (inline-const-val types))
            (inline-quote (memq (org-element-type ,node t) ,types))
          (inline-quote (eq (org-element-type ,node t) ,types)))))

]

>> with emacs -Q, indenting the file will yield different results with and
>> without executing (require 'inline).
>> With the patch, indentation becomes consistent.
> Hmm, I wonder whether there's a less heavy-handed approach to this.

Agreed.  Also, I think this problem is not specific to `define-inline`.
Maybe the indentation code should try and (auto)load the macros
it encounters.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at 68818 <at> debbugs.gnu.org:


Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 14:10:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 09:10:21 2024
Received: from localhost ([127.0.0.1]:34675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUoof-00059i-Go
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 09:10:21 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:54156)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rUood-00059O-At
 for 68818 <at> debbugs.gnu.org; Tue, 30 Jan 2024 09:10:20 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rUooL-0005l9-0c; Tue, 30 Jan 2024 09:10:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vgGMClEh0aaQpO43caDGeJ2zSKCgUJi3WNbQzZM4C68=; b=VXW1BWftNPwf
 2cVddlZ/B9XJsWqSkftWPONSNyn55IwyV1ISVaT2iH03juZLxuDZ7x7nUYJXDHFW3FOYTtKiAaOjX
 8rkkTq8zhmZdun+Vp2FLWyh/O1QgscusNMYMIBRVezUVzBpfg7oCL2At2zELW71vXAtD1xj6VxiqQ
 KL4H+n1ykTv+WpYI5T2NGkw6GEOJF7s6r3dExqcKrzULZCBky+VYj+5/vpsghv0j0tt1pWvpGDwwa
 vcKfz805KqybuJnjvp0bj5w9YBPArtn/kQoJJ5dQljllZ/99CXuaN+HFCs3DuUMJt3LYXaHjigrGr
 pK6mwOw7qKZxKph/gALitg==;
Date: Tue, 30 Jan 2024 16:09:52 +0200
Message-Id: <86cyti3ob3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <871q9zvtw0.fsf@localhost> (message from Ihor Radchenko on Tue,
 30 Jan 2024 13:21:51 +0000)
Subject: Re: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public
 macros
References: <871q9zvtw0.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68818
Cc: 68818 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Tue, 30 Jan 2024 13:21:51 +0000
> 
> This patch solves annoying problem with `define-inline' forms not being
> indented correctly unless inline.el is explicitly loaded.
> 
> For illustration, try to open the following foo.el file:
> 
> (define-inline org-element-type-p (node types)
>   "Return non-nil when NODE type is one of TYPES.
> TYPES can be a type symbol or a list of symbols."
>   (if (inline-const-p types)
>       (if (listp (inline-const-val types))
>           (inline-quote (memq (org-element-type ,node t) ,types))
>         (inline-quote (eq (org-element-type ,node t) ,types)))
>     (inline-letevals (node types)
>       (inline-quote
>        (if (listp ,types)
>            (memq (org-element-type ,node t) ,types)
>          (eq (org-element-type ,node t) ,types))))))
> 
> with emacs -Q, indenting the file will yield different results with and
> without executing (require 'inline).
> 
> With the patch, indentation becomes consistent.

Hmm, I wonder whether there's a less heavy-handed approach to this.

Stefan, any suggestions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Jan 2024 13:19:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 08:19:08 2024
Received: from localhost ([127.0.0.1]:34582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUo15-0003Xp-VX
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 08:19:08 -0500
Received: from lists.gnu.org ([2001:470:142::17]:39860)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rUo14-0003X6-5S
 for submit <at> debbugs.gnu.org; Tue, 30 Jan 2024 08:19:06 -0500
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 <yantar92@HIDDEN>)
 id 1rUo0d-0003HK-4b
 for bug-gnu-emacs@HIDDEN; Tue, 30 Jan 2024 08:18:47 -0500
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1rUo0P-0002ut-Gl
 for bug-gnu-emacs@HIDDEN; Tue, 30 Jan 2024 08:18:28 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 779E9240028
 for <bug-gnu-emacs@HIDDEN>; Tue, 30 Jan 2024 14:18:21 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1706620701; bh=CnoRpNX/v5VbNzf22VryaLpAzwBkT+JiTTaQeE4bUwU=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=IaWB2PwpZc9xOjj048gfPSSc+vudc2HRLj/t/1Wi7ov/Q5PiQkE+8I+SDMQEZusIq
 ye8IuO2j5tpT4w34ypPbZPFKVMBisIcKRh4nh4+vYe9LOMVQUk0PFGzzIStWn9xJa+
 m5/8DcV7ae+ORtY/byIGmB29mc1E6u/TM8O4ZMLZF22BXLaa1dnq5UkuZlxG242ruD
 tyRuGvaHfvW1GLnT5/zx9gtiuylMwKnWP+Ha/TjnnRGY7NZhddecLcm/Xl2PoyYQkx
 oytw/osL56Gub/nFW31os01LmuQP06HWDTMdo6RbhydwWi0Y3aWtS8p8w0lfBiLuz5
 umA69lNheSIjQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TPQhr4m7hz6tsb
 for <bug-gnu-emacs@HIDDEN>; Tue, 30 Jan 2024 14:18:20 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] lisp/emacs-lisp/inline.el: Autoload public macros
Date: Tue, 30 Jan 2024 13:21:51 +0000
Message-ID: <871q9zvtw0.fsf@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@HIDDEN;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Tags: patch

Hello,

This patch solves annoying problem with `define-inline' forms not being
indented correctly unless inline.el is explicitly loaded.

For illustration, try to open the following foo.el file:

(define-inline org-element-type-p (node types)
  "Return non-nil when NODE type is one of TYPES.
TYPES can be a type symbol or a list of symbols."
  (if (inline-const-p types)
      (if (listp (inline-const-val types))
          (inline-quote (memq (org-element-type ,node t) ,types))
        (inline-quote (eq (org-element-type ,node t) ,types)))
    (inline-letevals (node types)
      (inline-quote
       (if (listp ,types)
           (memq (org-element-type ,node t) ,types)
         (eq (org-element-type ,node t) ,types))))))

with emacs -Q, indenting the file will yield different results with and
without executing (require 'inline).

With the patch, indentation becomes consistent.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.39, cairo version 1.18.0) of 2024-01-28 built on localhost
Repository revision: 5e9ef5d65aea4c278bb58cfc84ea22e7983385da
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101010
System Description: Gentoo Linux

Configured using:
 'configure JAVAC=/etc/java-config-2/current-system-vm/bin/javac'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-lisp-emacs-lisp-inline.el-Autoload-public-macros.patch

From c6f64171998a00c017e9dae5d7c96ad6d277adb5 Mon Sep 17 00:00:00 2001
Message-ID: <c6f64171998a00c017e9dae5d7c96ad6d277adb5.1706620775.git.yantar92@HIDDEN>
From: Ihor Radchenko <yantar92@HIDDEN>
Date: Tue, 30 Jan 2024 14:18:23 +0100
Subject: [PATCH] lisp/emacs-lisp/inline.el: Autoload public macros

* lisp/emacs-lisp/inline.el (inline-quote):
(inline-const-p):
(inline-const-val):
(inline-error):
(inline-letevals): Autoload macros that may appear inside
`define-inline'.  This is necessary to load the indentation rules when
Elisp code that uses `define-inline' is edited.
---
 lisp/emacs-lisp/inline.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el
index c774296084e..af841c0458d 100644
--- a/lisp/emacs-lisp/inline.el
+++ b/lisp/emacs-lisp/inline.el
@@ -69,21 +69,25 @@
 
 (require 'macroexp)
 
+;;;###autoload
 (defmacro inline-quote (_exp)
   "Similar to backquote, but quotes code and only accepts , and not ,@."
   (declare (debug (backquote-form)))
   (error "inline-quote can only be used within define-inline"))
 
+;;;###autoload
 (defmacro inline-const-p (_exp)
   "Return non-nil if the value of EXP is already known."
   (declare (debug t))
   (error "inline-const-p can only be used within define-inline"))
 
+;;;###autoload
 (defmacro inline-const-val (_exp)
   "Return the value of EXP."
   (declare (debug t))
   (error "inline-const-val can only be used within define-inline"))
 
+;;;###autoload
 (defmacro inline-error (_format &rest _args)
   "Signal an error."
   (declare (debug t))
@@ -100,6 +104,7 @@ inline--letlisteval
   ;; inline-letevals, so signal the error in terms of the user's code.
   (error "inline-letevals can only be used within define-inline"))
 
+;;;###autoload
 (defmacro inline-letevals (vars &rest body)
   "Make sure the expressions in VARS are evaluated.
 VARS should be a list of elements of the form (VAR EXP) or just VAR, in case
-- 
2.43.0


--=-=-=
Content-Type: text/plain


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

--=-=-=--




Acknowledgement sent to Ihor Radchenko <yantar92@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#68818; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 19 Nov 2025 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.