From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#21423: 24.5; (package-initialize) added to init.el without (setq package-enable-at-startup nil) Date: Sun, 6 Sep 2015 13:59:22 +0100 Message-ID: References: <55EC1CF4.60006@orcon.net.nz> <55EC1F21.8080702@orcon.net.nz> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1441544434 25951 80.91.229.3 (6 Sep 2015 13:00:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Sep 2015 13:00:34 +0000 (UTC) Cc: 21423@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 06 15:00:17 2015 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 1ZYZYO-0001NL-Gb for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Sep 2015 15:00:16 +0200 Original-Received: from localhost ([::1]:48067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYZYO-0006G6-Gl for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Sep 2015 09:00:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYZYJ-0006FY-OK for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2015 09:00:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYZYF-0006gm-OV for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2015 09:00:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYZYF-0006fr-Hr for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2015 09:00:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZYZYE-000395-LQ for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2015 09:00:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2015 13:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21423 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21423-submit@debbugs.gnu.org id=B21423.144154436611943 (code B ref 21423); Sun, 06 Sep 2015 13:00:06 +0000 Original-Received: (at 21423) by debbugs.gnu.org; 6 Sep 2015 12:59:26 +0000 Original-Received: from localhost ([127.0.0.1]:50569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZYZXZ-00036W-Nu for submit@debbugs.gnu.org; Sun, 06 Sep 2015 08:59:26 -0400 Original-Received: from mail-la0-f48.google.com ([209.85.215.48]:35446) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZYZXX-00036I-Ur for 21423@debbugs.gnu.org; Sun, 06 Sep 2015 08:59:24 -0400 Original-Received: by lagj9 with SMTP id j9so38269359lag.2 for <21423@debbugs.gnu.org>; Sun, 06 Sep 2015 05:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=3qRBy2m7bEUeivh7BDGaaz9lwcv+t5zodw8/ssgM1+M=; b=o/WkBL8LIJchX2sswzMdHuPwkaUiYjvODXDYG44AiuHbwLBUf7Bs8l0of7Hhb9WTq2 BWXfcA4Vcbsks25i5lj0rXlTzkEqhbHjVtn47FgPDaK25sJrzhJYWTB/VnhKCn2+YSCM Ey9CxorB/NOF8Iu3gwjf1tadZ7wWOXrrj0yUrQtCERH9Otcp3vJ+flXm+5qpLGz8gjOF +PzcPYsRe4VXF+9fpfcSQx12nJ3VRFz8YyHUkFvxykXAf4fkosl5SDM54qzsWsv3KXOW ZVa1w+2JHuRqCeN7P4P0VoTdAX1cjVbd2V07bMmcJtkBMgcCE9YoBhpuHo++Wi0a2zVf kHfg== X-Received: by 10.112.161.137 with SMTP id xs9mr12740225lbb.4.1441544363047; Sun, 06 Sep 2015 05:59:23 -0700 (PDT) Original-Received: by 10.25.213.202 with HTTP; Sun, 6 Sep 2015 05:59:22 -0700 (PDT) In-Reply-To: <55EC1F21.8080702@orcon.net.nz> X-Google-Sender-Auth: orLAm2acZa6p4a4OZnUWhyisSto X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106187 Archived-At: I think I'd rather do the patch below. This will not only help the situation where we automatically add `(package-initialize)' to the init file, but it will also help those users who have manually added it without knowing about this caveat. Does anyone foresee problems with this? >From 94dafb46f7f258cb19929efc8bb9c123f428bcc5 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 6 Sep 2015 13:52:54 +0100 Subject: [PATCH] * lisp/emacs-lisp/package.el (package-initialize): Set enable-at-startup When `package-initialize' is called as part of loading the init file, the user probably doesn't want it to be called again afterwards. In this situation, `package-initialize' now sets `package-enable-at-startup' to nil to prevent that. The user can have the old behaviour by setting this variable to t after the call to `package-initialize'. (Bug#21423) --- lisp/emacs-lisp/package.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7c4f21f..57b35ca 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1378,7 +1378,9 @@ it to the file." (if (equal user-init-file load-file-name) ;; If `package-initialize' is being called as part of loading ;; the init file, it's obvious we don't need to ensure-init. - (setq package--init-file-ensured t) + (setq package--init-file-ensured t + ;; And likely we don't need to run it again after init. + package-enable-at-startup nil) (package--ensure-init-file)) (package-load-all-descriptors) (package-read-all-archive-contents) -- 2.5.1