[Top][All Lists]

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

Re: Summary and next steps for (package-initialize)

From: Clément Pit-Claudel
Subject: Re: Summary and next steps for (package-initialize)
Date: Thu, 24 Aug 2017 23:34:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 2017-08-24 20:29, Drew Adams wrote:
> That does modify much of what I've said.  If "activating the package
> system" means just processing the autoloads for packages that have
> been "installed", so that it is like doing `update-directory-autoloads'
> in each part of `load-path', then I guess I don't have a problem with
> such automatic "activation".

I just double checked to make sure :) package-initialize does this:

  (unless no-activate
    (dolist (elt package-alist)
      (package-activate (car elt))))

Then package-activate calls package-activate-1,
                which calls package--load-files-for-activation, 
                which calls package--activate-autoloads-and-load-path and calls 
`load' on all package files that were *already loaded*
                which is this:

  (defun package--activate-autoloads-and-load-path (pkg-desc)
    "Load the autoloads file and add package dir to `load-path'.
  PKG-DESC is a `package-desc' object."

SUmmarizing, package-initialize sets up the loadpath to include directories of 
all installed packages, and loads their autoload files.  Additionally, it 
reloads any already loaded (or `require'd) package file (it checks load-history 
for that):

    ;; Call `load' on all files in `package-desc-dir' already present in
    ;; `load-history'.  This is done so that macros in these files are updated
    ;; to their new definitions.  If another package is being installed which
    ;; depends on this new definition, not doing this update would cause
    ;; compilation errors and break the installation. 


reply via email to

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