From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#21429: 24.5; More robust test for calls to `package-initialize' in init file Date: Tue, 08 Sep 2015 02:26:26 +1200 Message-ID: <55ED9E92.9060702@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050804060205080105040808" X-Trace: ger.gmane.org 1441640271 26910 80.91.229.3 (7 Sep 2015 15:37:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Sep 2015 15:37:51 +0000 (UTC) To: 21429@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 07 17:37:39 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 1ZYyU9-0000pC-JQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Sep 2015 17:37:33 +0200 Original-Received: from localhost ([::1]:57152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxx0-0000U8-E5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Sep 2015 11:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxq2-0006K6-C5 for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:56:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxpz-00057Q-2X for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:56:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxpy-00056x-MG for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZYxpy-00063Q-G5 for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Sep 2015 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144163775523252 (code B ref -1); Mon, 07 Sep 2015 14:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2015 14:55:55 +0000 Original-Received: from localhost ([127.0.0.1]:51741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZYxpq-00062y-PI for submit@debbugs.gnu.org; Mon, 07 Sep 2015 10:55:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43817) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZYxpo-00062q-OT for submit@debbugs.gnu.org; Mon, 07 Sep 2015 10:55:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxpk-00051G-Vj for submit@debbugs.gnu.org; Mon, 07 Sep 2015 10:55:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxpk-00051C-SP for submit@debbugs.gnu.org; Mon, 07 Sep 2015 10:55:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxpf-00062R-SZ for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:55:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxpc-0004ya-1b for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:55:43 -0400 Original-Received: from [219.88.242.59] (port=43720 helo=mail.orcon.net.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxpb-0004wz-Ig for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2015 10:55:39 -0400 Original-Received: from [10.1.1.5] (202-150-102-33.bng1.avl.orcon.net.nz [202.150.102.33] (may be forged)) (authenticated bits=0) by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id t87EQQi8018637 for ; Tue, 8 Sep 2015 02:26:27 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined, tokens from: outbound) X-CanIt-Geo: ip=202.150.102.33; country=NZ; latitude=-41; longitude=174.0000; http://maps.google.com/maps?q=-41,174.0000&z=6 X-CanItPRO-Stream: base:outbound X-Canit-Stats-ID: 01PeeqqC5 - 81ee592c41be - 20150908 X-Scanned-By: CanIt (www . roaringpenguin . com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:106216 Archived-At: This is a multi-part message in MIME format. --------------050804060205080105040808 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit The code which checks the user's init file for calls to `package-initialize' doesn't take the optional argument to that function into account. --------------050804060205080105040808 Content-Type: text/x-patch; name="0001-More-robust-check-for-package-initialize-calls-in-in.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-More-robust-check-for-package-initialize-calls-in-in.pa"; filename*1="tch" >From e4031d15e635493b69e5402acec33861817303ad Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Tue, 8 Sep 2015 02:15:53 +1200 Subject: [PATCH] More robust check for `package-initialize' calls in init file. This function accepts an optional argument, but calls passing an argument would not have been detected. --- lisp/emacs-lisp/package.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 23247d7..45d66f6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1838,12 +1838,12 @@ add a call to it along with some explanatory comments." (save-restriction (widen) (goto-char (point-min)) - (search-forward "(package-initialize)" nil 'noerror)))) + (re-search-forward "(package-initialize\\_>" nil 'noerror)))) ;; Don't visit the file if we don't have to. (with-temp-buffer (insert-file-contents user-init-file) (goto-char (point-min)) - (search-forward "(package-initialize)" nil 'noerror))))) + (re-search-forward "(package-initialize\\_>" nil 'noerror))))) (unless contains-init (with-current-buffer (or buffer (let ((delay-mode-hooks t)) -- 2.1.0 --------------050804060205080105040808--