unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19151: 24.4; Batch mode doesn't call package-initialize, can't find packages
@ 2014-11-22 22:24 Gary Oberbrunner
  2014-11-23 11:26 ` Ted Zlatanov
  2014-11-23 16:29 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Gary Oberbrunner @ 2014-11-22 22:24 UTC (permalink / raw)
  To: 19151

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

In batch mode, emacs doesn't load installed packages, although the doc
implies that it should.  If you want to eval forms that require packages,
you have to call (package-initialize) explicitly.

For instance, from a shell:

% emacs -batch -eval '(progn (message "%s" package-directory-list))'
Symbol's value as variable is void: package-directory-list
% emacs -batch -eval '(progn (package-initialize) (message "%s"
package-directory-list))'
(c:/emacs/emacs/share/emacs/24.4/site-lisp/elpa
c:/emacs/emacs/share/emacs/site-lisp/elpa)

Or, since I have the 'dash' package installed in my ~/.emacs.d/elpa:

% emacs -batch -eval "(progn (require 'dash))"
Cannot open load file: no such file or directory, dash
% emacs -batch -eval "(progn (package-initialize) (require 'dash))"
%

The documentation at
http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html
is not totally clear on this, but it implies that packages should be loaded.



In GNU Emacs 24.4.1 (i686-pc-mingw32)
 of 2014-10-24 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr'

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Apropos


-- 
Gary

[-- Attachment #2: Type: text/html, Size: 1883 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-03 13:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-22 22:24 bug#19151: 24.4; Batch mode doesn't call package-initialize, can't find packages Gary Oberbrunner
2014-11-23 11:26 ` Ted Zlatanov
2014-11-23 16:29 ` Eli Zaretskii
2016-07-02  1:24   ` npostavs
2016-07-02  8:00     ` Eli Zaretskii
2016-07-02 20:50       ` npostavs
2016-07-03  4:14         ` Eli Zaretskii
2016-07-03 13:21           ` npostavs

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).