From 2bad549b954ccd659d8db58cf1e42e257496803b Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 13 Apr 2015 20:50:33 +0100 Subject: [PATCH] * lisp/emacs-lisp/package.el: Fix package--ensure-init-file --- lisp/emacs-lisp/package.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6fb5ba45468..f3333751606 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1781,7 +1781,9 @@ using `package-compute-transaction'." (contains-init (if buffer (with-current-buffer buffer - (search-forward "(package-initialize)" nil 'noerror)) + (save-excursion + (goto-char (point-min)) + (search-forward "(package-initialize)" nil 'noerror))) (with-temp-buffer (insert-file-contents user-init-file) (goto-char (point-min)) -- 2.39.2