unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] master 4449301: * etc/NEWS: Improve documentation of 'package-initialize'.
Date: Mon, 11 Nov 2019 17:07:07 +0100	[thread overview]
Message-ID: <CADwFkmnpKy=aJCEz0SKw4b5c6DPjU0t-nVX-=+0rDGBALfhzww@mail.gmail.com> (raw)
In-Reply-To: <jwvh83jfshg.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > I started looking into package-enabe-at-startup, and of course the
> > above reasoning goes for package-load-list and package-user-dir; that
> > is, setting them via customize has no effect.
>
> Yes and no: you can set `package-load-list` and `package-user-dir` in
> your .emacs (and/or via customize) in order to affect the place where
> packages are later installed and also in order to affect a subsequent
> manual package-activate-all.
>
> Currently, this requires setting (setq package-alist nil) by hand to
> force reloading the package descriptors, but my hope is that we can
> improve this in the future (e.g. with a :setter placed on those vars so
> that package-activate-all is called again when they're modified via
> custom).

OK, thanks for explaining that.  I have attached a patch which changes
package-enable-at-startup into a defvar for now.

I've also added documentation to package-load-list and
package-user-dir to explain the above quirks.

Any comments?

> Also, a "late-setting" of `package-load-list` (e.g. when set via
> customize) will still work if you use `package-quickstart`.

I have two questions here:

1. I can't find anything on package-quickstart in the user manual.  Is
that intentional?  Perhaps it would make sense to create a new node
"initialization of packages" which could describe all this.

2. Should package-quickstart have a :set attribute with a value of
'package-quickstart-refresh?

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Make-package-enable-at-startup-into-defvar.patch --]
[-- Type: text/x-patch, Size: 4611 bytes --]

From 398ca928da1ff9e400836a365c4482949e03cea1 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sat, 2 Nov 2019 06:46:09 +0100
Subject: [PATCH] Make package-enable-at-startup into defvar

* lisp/emacs-lisp/package.el (package-enable-at-startup): Change
from defcustom to defvar, since this has to be set in the early init
file (that is, normally before custom has been loaded).
* doc/lispref/package.texi (Packaging Basics): Document it.
* etc/NEWS (XDG_CONFIG_HOME): Announce it.

* lisp/emacs-lisp/package.el (package-load-list)
(package-user-dir): Doc fix to explain how to make them take effect
during startup.
---
 doc/lispref/package.texi   |  2 +-
 etc/NEWS                   |  3 +++
 lisp/emacs-lisp/package.el | 28 ++++++++++++++++++----------
 3 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index 236855bdf8..a8a136f187 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -109,7 +109,7 @@ Packaging Basics
 @code{package-activate-all} to make installed packages available to the
 current session.  This is done after loading the early init file, but
 before loading the regular init file (@pxref{Startup Summary}).
-Packages are not automatically made available if the user option
+Packages are not automatically made available if the variable
 @code{package-enable-at-startup} is set to @code{nil} in the early
 init file.
 
diff --git a/etc/NEWS b/etc/NEWS
index 4134f7bb5f..48c66d7557 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -191,6 +191,9 @@ it won't work right without some adjustment:
   does not need to pay attention to 'package-load-list' or
   'package-user-dir' any more.
 
+The value of 'package-enable-at-startup' can no longer be changed
+using customize.  You have to set it manually in your early init file.
+
 ---
 ** Emacs now notifies systemd when startup finishes or shutdown begins.
 Units that are ordered after 'emacs.service' will only be started
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6b75ecf783..f1835a424f 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -162,20 +162,20 @@ package
 ;;; Customization options
 
 ;;;###autoload
-(defcustom package-enable-at-startup t
+(defvar package-enable-at-startup t
   "Whether to make installed packages available when Emacs starts.
 If non-nil, packages are made available before reading the init
 file (but after reading the early init file).  This means that if
-you wish to set this variable, you must do so in the early init
-file.  Regardless of the value of this variable, packages are not
-made available if `user-init-file' is nil (e.g. Emacs was started
-with \"-q\").
+you wish to set this variable to nil, you must do that in the
+early init file.  See Info node `(emacs) Early Init File'.
+
+Regardless of the value of this variable, packages are not made
+available if `user-init-file' is nil (e.g. Emacs was started with
+\"-q\").
 
 Even if the value is nil, you can type \\[package-initialize] to
 make installed packages available at any time, or you can
-call (package-initialize) in your init-file."
-  :type 'boolean
-  :version "24.1")
+call (package-initialize) in your init-file.")
 
 (defcustom package-load-list '(all)
   "List of packages for `package-initialize' to make available.
@@ -190,7 +190,11 @@ package-load-list
 If VERSION is a string, only that version is ever made available.
  Any other version, even if newer, is silently ignored.
  Hence, the package is \"held\" at that version.
-If VERSION is nil, the package is not made available (it is \"disabled\")."
+If VERSION is nil, the package is not made available (it is \"disabled\").
+
+If you want this to take effect during the automatic package
+activation when Emacs starts, you have to set this variable in
+the early init file.  See Info node `(emacs) Early Init File'."
   :type '(repeat (choice (const all)
                          (list :tag "Specific package"
                                (symbol :tag "Package name")
@@ -293,7 +297,11 @@ package-user-dir
   "Directory containing the user's Emacs Lisp packages.
 The directory name should be absolute.
 Apart from this directory, Emacs also looks for system-wide
-packages in `package-directory-list'."
+packages in `package-directory-list'.
+
+If you want this to take effect during the automatic package
+activation when Emacs starts, you have to set this variable in
+the early init file.  See Info node `(emacs) Early Init File'."
   :type 'directory
   :risky t
   :version "24.1")
-- 
2.20.1


  reply	other threads:[~2019-11-11 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191022021600.2389.91268@vcs0.savannah.gnu.org>
     [not found] ` <20191022021602.B41B3209DE@vcs0.savannah.gnu.org>
2019-10-22 12:28   ` [Emacs-diffs] master 4449301: * etc/NEWS: Improve documentation of 'package-initialize' Stefan Monnier
2019-10-23 12:12     ` Stefan Kangas
2019-10-23 12:49       ` Stefan Monnier
2019-11-02  4:57         ` Stefan Kangas
2019-11-04 17:53           ` Stefan Monnier
2019-11-11 16:07             ` Stefan Kangas [this message]
2019-11-12 15:50               ` Stefan Monnier
2019-11-18 14:58                 ` Stefan Kangas
2019-11-14 11:16               ` Eli Zaretskii
2019-11-18 15:05                 ` Stefan Kangas
2019-11-02  3:34       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmnpKy=aJCEz0SKw4b5c6DPjU0t-nVX-=+0rDGBALfhzww@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).