emacs-devel
[Top][All Lists]
Advanced

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

Re: Calling (package-initialize) sooner during initialization


From: Ted Zlatanov
Subject: Re: Calling (package-initialize) sooner during initialization
Date: Sat, 18 Apr 2015 06:46:48 -0400
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

On Mon, 30 Mar 2015 16:44:04 -0400 Stefan Monnier <address@hidden> wrote: 

>> Option 2) Instead of us manually telling users to add
>> `(package-initialize)' to their init-files, we have Emacs do that
>> automatically. Similar to how `custom.el' adds a call to
>> `custom-set-variables' the first time you save a variable; package.el
>> could add a call to `package-initialize' the first time you install a
>> package.

SM> I think that's the way to go, indeed.

Ugh.  Sadly it seems to be the only reasonable way without changing what
`package-initialize' does fundamentally.

But I would approach this with command-line switches for Emacs, see below.

On Sun, 12 Apr 2015 12:07:24 +0200 Vasilij Schneidermann <address@hidden> 
wrote: 

>> We discussed this already.  There's the issue of configuring package.el
>> before loading it and/or before calling package-initialize.

VS> OK, I've checked again and sighted eight customization candidates in
VS> package.el:

VS> - package-enable-at-startup: Would be equivalent to the proposed
VS>   environment variable.
VS> - package-load-list: Needs to be configured before.
VS> - package-archives: Needs to be configured before for
VS>   non-interactive package installation.
VS> - package-pinned-packages: Needs to be configured before for
VS>   non-interactive package installation.
VS> - package-user-dir: Needs to be configured before.
VS> - package-directory-list: Needs to be configured before.
VS> - package-check-signature and package-unsigned-archives: Can be
VS>   customized afterwards

I think `package-check-signature' should also be configured before for
batch operation.

There aren't that many variables and they are all package-related. So
maybe support "emacs --package-xyz=foo" for all the above, for the
exceptional cases where the default setup of `package-initialize' is
wrong. Unlike --eval, the --package switches would know to notify the
internals. And unlike environment variables, the operation mode would be
explicitly encoded in the invocation.

Regardless of how it's implemented, I would make it easier for beginners
at the expense of making customizations a little harder for advanced
users and making batch operations complicated (because they usually
already are). So, for instance, environment variables for begginers are
not great because beginners are not going to write a wrapper shell
script.

I think, unfortunately, in the end it's easiest to keep the current
"just put this in your init file" situation. We could do worse :)

Ted




reply via email to

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