GNU bug report logs -
#19151
24.4; Batch mode doesn't call package-initialize, can't find packages
Previous Next
Reported by: Gary Oberbrunner <garyo <at> oberbrunner.com>
Date: Sat, 22 Nov 2014 22:32:02 UTC
Severity: minor
Tags: fixed, patch
Found in version 24.4
Fixed in version 25.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> +It calls the function @code{package-initialize} to activate any
>> +optional Emacs Lisp package that has been installed. @xref{Packaging
>> +Basics}. This is not done if @code{package-enable-at-startup} is
>> +@code{nil}, nor if the options @samp{-q}, @samp{-Q}, or @samp{--batch}
>> +were specified.
>
> I would rephrase the last sentence:
>
> However, when @code{package-enable-at-startup} is @code{nil}, Emacs
> doesn't initialize packages. When Emacs is started with one of the
> options @samp{-q}, @samp{-Q}, or @samp{--batch},
> @code{package-enable-at-startup} is @code{nil} by default; to
> initialize packages in that case, explicitly set that variable to a
> non-@code{nil} value (e.g., via the @samp{--eval} option).
Phrasing is alright, but it's factually inaccurate. In startup.el we
have
;; If any package directory exists, initialize the package system.
(and user-init-file
package-enable-at-startup
...[lots more file searching]
(package-initialize))
The -q option sets user-init-file to nil. I guess we needn't mention
user-init-file by name in the docs as it's an internal detail. Here's a
new patch:
[v2-0001-Explain-when-package-initialize-isn-t-called.patch (text/x-diff, inline)]
From b1d2cf2c2ca86151c25d1c59c7eb210179086be2 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 1 Jul 2016 21:15:28 -0400
Subject: [PATCH v2] Explain when package-initialize isn't called
* doc/lispref/os.texi (Startup Summary): Explain that package-initialize
is not called when options -q, -Q, or --batch were passed (Bug #19151).
---
doc/lispref/os.texi | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 5f189b9..ec14b01 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -155,9 +155,13 @@ Startup Summary
option @samp{--batch} was specified.
@item
-If @code{package-enable-at-startup} is non-@code{nil}, it calls the
-function @code{package-initialize} to activate any optional Emacs Lisp
-package that has been installed. @xref{Packaging Basics}.
+It calls the function @code{package-initialize} to activate any
+optional Emacs Lisp package that has been installed. @xref{Packaging
+Basics}. However, Emacs doesn't initialize packages when
+@code{package-enable-at-startup} is @code{nil} or when it's started
+with one of the options @samp{-q}, @samp{-Q}, or @samp{--batch}. To
+initialize packages in the latter case, @code{package-initialize}
+should be called explicitly (e.g., via the @samp{--funcall} option).
@vindex after-init-time
@item
--
2.8.0
This bug report was last modified 9 years and 16 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.