[Top][All Lists]

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

Adding to package-directory-list on the command line

From: sbaugh
Subject: Adding to package-directory-list on the command line
Date: Sun, 15 Nov 2020 12:27:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)


How can I add a directory to package-directory-list on the command line
before init.el runs?

As part of the NixOS support for Emacs, I want to wrap Emacs to add a
directory to package-directory-list.

Since this is a distro wrapper, not a user customization, I don't have
control over early-init.el.

I tried using --eval or other command line arguments, but they all run
after init.el.

Previously, this wrapper used EMACSLOADPATH to put a directory
containing a new site-start.el on load-path. But, EMACSLOADPATH gets
inherited to subprocesses, which can be quite confusing if you start up
a different version of Emacs as a subprocess.  Also, the original
site-start.el of the un-wrapped Emacs won't be loaded unless the new
site-start.el explicitly searches for it and loads it.  The modification
of package-directory-list can't be put in the original site-start.el
because this is an optional wrapper (to manage Emacs packages with Nix)
which is built after Emacs itself.

It seems that, by analogy with early-init.el, we need some kind of
--early-eval command line argument to allow invoking Emacs with
customizations to the package system. But maybe that already exists in
some form I don't yet see?


reply via email to

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