emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch: perform autoloading when docs is missing from autoload object


From: Stefan Monnier
Subject: Re: Patch: perform autoloading when docs is missing from autoload object
Date: Sat, 18 Sep 2021 09:37:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I just tested with generated package-quickstart.el file. Below is what I get
> when I M-: (symbol-function 'winum-select-window-0), as both before I
> byte-compiled and after I byte-compiled:

How did you perform the test?

I tested it on my end with the `loaddefs.el` file and "it worked", but
it required several tweaks (like removing the `no-byte-compile:t` from
the file-local variables, and telling `loadup.el` to load `loaddefs`
rather than `loaddefs.el`).

So I wouldn't be surprised if you need to take extra steps to convince
Emacs to compile the file and to load the compiled version of the file.

> So the entire business of docs in autoloads is due to autoload file 
> generation,
> seems to me, if I don't misunderstanding something?

I'm afraid I don't know what you mean by "business of docs in autoloads".

> I certainly have no problems if autoloads generation is fixed and
> built-in autoloads file generator emitted byte offsets instead of kilo
> bytes of fully embedded docs.

Indeed, I think we should be possible to change `autoload.el` so that it
directly generates the "comment + byte-offsets" form in the .el files
so we don't even need to byte-compile them.  Not sure if it's a better
than byte-compiling them.

> But there is the case that nil is a valid value for doc in autoload
> object, and thus I think it is still important to fix help system, to
> fetch docs on demand.

That's true.  We could also just always use nil and always load the
source file to find the doc.  I'm not sure in that case it'd be worth
the trouble trying to avoid loading the whole file (I think it'd take
a fair bit of effort to make it work reliably enough).


        Stefan




reply via email to

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