From: Phil Sainty Date: Mon, 7 Sep 2015 14:15:53 +0000 (+1200) Subject: * lisp/emacs-lisp/package.el (package--ensure-init-file) X-Git-Tag: emacs-25.0.90~1224^2~183 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b074436925a0fe8329ef86d0a36238f5c593888c;p=emacs.git * lisp/emacs-lisp/package.el (package--ensure-init-file) 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. --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b0d2ff96629..eb66e8f25a3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1852,12 +1852,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))