From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public macros Date: Tue, 30 Jan 2024 16:24:25 +0000 Message-ID: <87sf2e23ie.fsf@localhost> References: <871q9zvtw0.fsf@localhost> <86cyti3ob3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7770"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 68818@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 30 17:22:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUqsW-0001pA-J3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jan 2024 17:22:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUqs9-0004TM-32; Tue, 30 Jan 2024 11:22:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUqry-0004Mz-2E for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 11:22:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUqrx-00026D-8T for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 11:21:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUqs6-00010k-6g for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 11:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jan 2024 16:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68818-submit@debbugs.gnu.org id=B68818.17066316743797 (code B ref 68818); Tue, 30 Jan 2024 16:22:02 +0000 Original-Received: (at 68818) by debbugs.gnu.org; 30 Jan 2024 16:21:14 +0000 Original-Received: from localhost ([127.0.0.1]:36553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUqrJ-0000zA-Ih for submit@debbugs.gnu.org; Tue, 30 Jan 2024 11:21:13 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:34089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUqrH-0000yZ-1m for 68818@debbugs.gnu.org; Tue, 30 Jan 2024 11:21:12 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CF9A7240103 for <68818@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== Original-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) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279188 Archived-At: Stefan Monnier 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 . Support Org development at , or support my work at