emacs-devel
[Top][All Lists]
Advanced

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

Re: Loading a package applies automatically to future sessions?


From: Clément Pit-Claudel
Subject: Re: Loading a package applies automatically to future sessions?
Date: Sun, 4 Feb 2018 10:21:24 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

>   > There may be a misunderstanding.  Emacs already works in (mostly) the 
> same way: Emacs' `require' is very close to Python's `import'.
> 
> That's the behavior I'd expect a feature like this to have.
> 
>   > * Emacs has autoloads, small pieces of code from packages that are run 
> inconditionally.
> 
> I do know about autoloads; I implemented them.

I know that; but I'm writing to the entire list, and there may be other readers 
who are less familiar with autoloads :)

> The questions are (1) do a lot of these packages have autoloads, or just
> a few, and (2) when do the autoloads get installed into Emacs.

Most packages, AFAICT, make their main interactive entry points autoloads.  I 
think that is the right behavior.

> If adding a package to the list for loading has the effect of installing
> its autploads in all future sessions, that results in behavior very
> different from the 'require' behavior, and behavior that doesn't match
> what I'd expect such a feature to have.
> 
> Does Python have autoloads?  I would expect not.

Yes, in two senses:

* Installing a package with 'pip' commonly installs small binaries in your 
path, so you can call the program from the command line.
* Python has .pth files that work essentially like Emacs autoloads.  These 
aren't used very commonly.

> Since the effect of calling an autoload function is to call 'require',
> it could be that lexical handling of 'require' will automatically
> clean up the way these autoloads are handled.

The thing is, I don't a the problem with the way autoloads are currently 
handled.  seeWe just need to find a way to make processing autoloads faster, 
and in fact Stefan has a solution for that, IIUC.

The fact that installing a package installs its autoloads is desirable; just 
like the fact that running 'apt-get install emacs' puts the emacs binary on 
your path.

I think lexical vs dynamic 'require' is a different issue.

Clément.



reply via email to

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