emacs-devel
[Top][All Lists]
Advanced

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

Re: Interoperation between package managers


From: Stefan Monnier
Subject: Re: Interoperation between package managers
Date: Sun, 13 Aug 2017 17:43:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> Borg installs packages by cloning the respective git repository and then
> byte-compiling the libraries, generating the autoload file, generating
> the info files, and adding the appropriate directories to `load-path'
> and `Info-directory-list'.

Right, that's similar to what I do by adding the git clone as a symlink
in .../elpa/packages.

> That works surprisingly well, because most packages follow some informal
> common sense conventions.

That's indeed my experience as well.

> I don't think that adding the directory that contains the Borg-installed
> packages to `package-directory-list' would do because:

[ Which is indeed the way I'd naturally/naively see it integrated  ]

> * That would cause package.el to load those packages, resulting in them
>   being loaded twice.  (At least they would be added to the `load-path'
>   twice.)

Why loaded twice?  Do you mean because package-initialize does it once
and then borg-initialize does it a second time?  If so, then I'd suggest
to change Borg so it doesn't do it (and relies on package.el to do it
instead).

> * While some of these directories follow the format expected by
>   package.el, others do not.  For example in many repositories libraries
>   live in ./lisp/ instead of ./.

Currently I deal with this by making the symlink point to the
.../<pkg>/lisp rather than to .../<pkg>/lisp.  This also works for cases
where git clone gives me a large package which includes some Elisp
support package inside (typically the git repository for a new
language, which includes a compiler along with some support code for
various editors).

There's been some efforts to extend package.el so it can better handle .el
files in subdirectories, but there's more work to do there.

But normally the way a package is activated by package.el is just by
loading <pkg>-autoloads.el so that can deal just fine with the case
where the .el files are in .../lisp: it's the responsibility of the code
that installs the package to compile the files in .../lisp and to setup
the autoloas in <pkg>-autoloads.el; and the code in <pkg>-autoloads.el
can add the .../lisp dir to load-path rather than the top-level dir.

> The only thing that annoys me a bit is that when I use `emacs -Q' to
> debug some issue without my configuration, then I end up with
> ~/.emacs.d/elpa being created.

Sounds like a bug, indeed.  Could you M-x report-emacs-bug with a recipe
to reproduce it?

> It would nice if `package-initialize' did not do that and would only
> *update* the local metadata if it is already there.

AFAIK package-initialize doesn't update any local metadata.

> Later when the user calls `package-list-package' or `package-install',
> then the initial local copy of the metadata could be downloaded.

That's what happens, AFAIK.


        Stefan




reply via email to

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