>From c8287af963e5de462c572c7b0a95554fb96bba7d Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Sun, 6 Sep 2015 23:05:34 +1200 Subject: [PATCH] Disable package-enable-at-startup when forcing package-initialize --- lisp/emacs-lisp/package.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d4a2f02..3b70880 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1833,12 +1833,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)) @@ -1853,9 +1853,10 @@ add a call to it along with some explanatory comments." (insert "\n" ";; Added by Package.el. This must come before configurations of\n" - ";; installed packages. Don't delete this line. If you don't want it,\n" - ";; just comment it out by adding a semicolon to the start of the line.\n" - ";; You may delete these explanatory comments.\n" + ";; installed packages. Don't delete these lines. If you don't want\n" + ";; them, just comment them out by adding a semicolon to the start of\n" + ";; each line. You may delete these explanatory comments.\n" + "(setq package-enable-at-startup nil)\n" "(package-initialize)\n") (unless (looking-at-p "$") (insert "\n")) -- 2.1.0