From 398ca928da1ff9e400836a365c4482949e03cea1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas 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