emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master add49b6: * lisp/emacs-lisp/package.el: Reduce a


From: Artur Malabarba
Subject: Re: [Emacs-diffs] master add49b6: * lisp/emacs-lisp/package.el: Reduce autoloading before compiling
Date: Tue, 8 Sep 2015 02:59:20 +0100

package-activate-1 was being called twice during installation. Once
before compilation and once after.
IIUC, there are only two things in package-activate-1 that affect
byte-compilation: setting the load-path and loading the autoloads
file. So I refactored those two functionalities into
`package--activate-autoloads-and-load-path'.

Now, instead of calling `package-activate-1' before compilation, we
call this new simpler function.
`package-activate-1' is still called after compilation, and it's
functionality has not changed (it still sets the load-path and loads
autoloads by calling this new function, in addition to the other stuff
that it does).

1) `package-activate-1' has a couple of line that shouldn't be called
twice, like (push name package-activated-list) and (push pkg-dir
Info-directory-list). It wasn't the end of the world, but it was wrong
(again, IIUC) and it could get worse if we extend this function in the
future.

2) It's just confusing to see a package being activated twice
throughout a single installation. I find it more informative to do
specifically what we want (i.e., load autloads and set load-path
before compilation).

3) The name package-activate-1 gives the impression that it's an
implementation function for package-activate, which made it confusing
that it was being called outside package-activate.


2015-09-08 2:33 GMT+01:00 Stefan Monnier <address@hidden>:
>>     (package--autoloads-file-name)
>>     (package--activate-autoloads-and-load-path): New function.
>>     (package-activate-1): Delegate autoloading and load-path
>>     configuration to `package--activate-autoloads-and-load-path'.
>>     (package--compile): Before compilation, call
>>     `package--activate-autoloads-and-load-path' instead of
>>     `package-activate-1'.
>
> Not sure I follow what this is doing, nor why.  Can you explain?
>
>
>         Stefan



reply via email to

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