]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/package.el (package--ensure-init-file)
authorPhil Sainty <psainty@orcon.net.nz>
Mon, 7 Sep 2015 14:15:53 +0000 (02:15 +1200)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 9 Sep 2015 11:12:30 +0000 (12:12 +0100)
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

index b0d2ff96629dc1e2a4de85661f49771a09e8e63f..eb66e8f25a3dcbb913cff46c88463ac43e4d4c8f 100644 (file)
@@ -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))