[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 4449301: * etc/NEWS: Improve documentation of '
From: |
Stefan Kangas |
Subject: |
Re: [Emacs-diffs] master 4449301: * etc/NEWS: Improve documentation of 'package-initialize'. |
Date: |
Wed, 23 Oct 2019 14:12:11 +0200 |
Stefan Monnier <address@hidden> writes:
> > +(when (version< emacs-version "27.1")
> > + (package-initialize))
>
> That doesn't do the right thing with the current `master` (nor will it
> with Emacs-27.1's pretest).
Good point, thanks.
> Maybe a better option is
>
> (when package-enable-at-startup
> (package-initialize))
Yes, that would work. But I'm not sure I understand this variable in general.
It is a defcustom (a user option), but:
1. It's ineffective when set from the custom interface, since it has
to be in the early init file. Right?
2. It is a user option, but gets set automatically by
package-initialize. This makes it a bit confusing, because
describe-variable says:
package-enable-at-startup is a variable defined in ‘package.el’.
Its value is nil
Original value was t
I initially thought this meant *I* had changed it for some reason,
because that's usually what it means when Emacs reports that it has
changed, and then I was confused when I couldn't find out where. Only
after a while did I understand that this is a user option that doubles
as a variable that tracks if the package system was initialized or
not.
Would this be better as a defvar instead? Or should we introduce a
new variable to mean that we are already initialized? I don't mean to
rehash old discussions here, so feel free to refer me to earlier
discussions if you've already had them.
> or
>
> (unless package-activated-list
> (package-initialize))
That could also work. Do we prefer not to do this by version? For
example, my suggestion would probably have been:
(unless (< emacs-major-version 27)
(package-initialize))
Best regards,
Stefan Kangas