From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#19151: 24.4; Batch mode doesn't call package-initialize, can't find packages Date: Sat, 02 Jul 2016 16:50:42 -0400 Message-ID: <877fd3hihp.fsf@users.sourceforge.net> References: <837fylsww5.fsf@gnu.org> <87furshlwi.fsf@users.sourceforge.net> <837fd4tqow.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1467492688 17220 80.91.229.3 (2 Jul 2016 20:51:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jul 2016 20:51:28 +0000 (UTC) Cc: garyo@oberbrunner.com, 19151@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 02 22:51:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bJRsf-0005Ga-VF for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2016 22:51:14 +0200 Original-Received: from localhost ([::1]:40051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJRse-0000dG-Uw for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2016 16:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJRsY-0000cx-Ce for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 16:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJRsU-0000qk-5L for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 16:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJRsU-0000qf-1a for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 16:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bJRsT-0001Qa-P1 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2016 16:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2016 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19151 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19151-submit@debbugs.gnu.org id=B19151.14674926425464 (code B ref 19151); Sat, 02 Jul 2016 20:51:01 +0000 Original-Received: (at 19151) by debbugs.gnu.org; 2 Jul 2016 20:50:42 +0000 Original-Received: from localhost ([127.0.0.1]:34883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJRsA-0001Q3-HL for submit@debbugs.gnu.org; Sat, 02 Jul 2016 16:50:42 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:37506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJRs8-0001Pq-QN for 19151@debbugs.gnu.org; Sat, 02 Jul 2016 16:50:41 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id f6so40162440ith.0 for <19151@debbugs.gnu.org>; Sat, 02 Jul 2016 13:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BWhGVxajW/msIW/j2B6MQtwxb8z8ZJRAcDXhM/eheTE=; b=bkdnLWW9UK15IG4RSldXghJhpy0+oKK3ttBmlVucijmycPuMjG1tepcUus+uF20bt2 AgzgP9occ4XynSBMsrzdPR3DQCCPu3K9i+K1iaN3dKzJxJDsA5HMUm2Icp+rFEzDGX8o 7CL0oM7Mu8VdtG89VDC+BiGBiopwTjk0YNZJraLrBKOK8pKUi7L48zy8vPAWl2wk/uus P2QwR6OD1FKBoP0v5QqG1w5mdpAJ5Wzw/C4gmtfTXrrHQ1hnhSfh9n37j+h3+Xc2p0dU 6KQ8+4H3cm7lD9n7vRlU5xoAhaaLt5ZEg7+bCxQT8MbDdZ98kBdjoo4CmAr5sZjrgejo kc0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=BWhGVxajW/msIW/j2B6MQtwxb8z8ZJRAcDXhM/eheTE=; b=W89//xLPBMHY/6sd9XwFvpstJHpeVo1JFH/gDSOtMjfHxCqjiiE7rXcv2bQ1fUy7+u Bb8XsVMjtpGbASWqkNtWSSCpTxu3ST0b9iV/Rf7O4CzRV5IBsry8ooltTeTOR2KK27CP hSLTjkaxq7Grt1/oGpuvbGFpzqMedW5mKNIH91DYgJH0gXwrpC4yNjcw1OeRNNlxYYGV evvHm2CB6N0H+C+x0ZNeP3/0pHVBp5SQJaqPgDlmHLvWSWZoJ+zMwaD7qgGEB3EgLI98 mWjTZDJi4IFPiwZbU0gjLw2NQ/2VA/Ntkhb7N2tUsIXCZcOMiPB/MWo/5y6tgfDDPfcx rasQ== X-Gm-Message-State: ALyK8tLs7tuCJ3LF7yzQwa7VwKsUAlhp+kfeZUM/7kHsupghWUJTEhKgj2mhSgzcuWWeZg== X-Received: by 10.36.47.76 with SMTP id j73mr3837206itj.82.1467492635294; Sat, 02 Jul 2016 13:50:35 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id y73sm2181105iof.32.2016.07.02.13.50.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jul 2016 13:50:34 -0700 (PDT) In-Reply-To: <837fd4tqow.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Jul 2016 11:00:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120306 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Explain-when-package-initialize-isn-t-called.patch Content-Description: patch2 >From b1d2cf2c2ca86151c25d1c59c7eb210179086be2 Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 --=-=-=--