bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Monnier
Subject: bug#68818: [PATCH] lisp/emacs-lisp/inline.el: Autoload public macros
Date: Tue, 30 Jan 2024 13:11:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]