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.
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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>
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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>
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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?
bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.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> --=-=-=--
Ihor Radchenko <yantar92@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#68818
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.