Subject: bug#21429: closed (Re: bug#21429: 24.5; More robust test for calls to `package-initialize' in init file)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 09 Sep 2015 11:15:03 +0000

Your bug report

#21429: 24.5; More robust test for calls to `package-initialize' in init file

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21429: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21429
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21429: 24.5; More robust test for calls to `package-initialize' in init file
From: Artur Malabarba <[email-masked]>
To: [email-masked]
Date: Wed, 9 Sep 2015 12:14:35 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Pushed.
Thanks again.

2015-09-08 2:08 GMT+01:00 Phil Sainty <[email-masked]>:
> On 2015-09-08 08:34, Artur Malabarba wrote:
>>
>> Have you done the copyright paperwork?
>
>
> Yes.
>

Subject: 24.5; More robust test for calls to `package-initialize' in init file
From: Phil Sainty <[email-masked]>
To: [email-masked]
Date: Tue, 08 Sep 2015 02:26:26 +1200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

>From e4031d15e635493b69e5402acec33861817303ad Mon Sep 17 00:00:00 2001
From: Phil Sainty <[email-masked]>
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