From: Artur Malabarba Date: Mon, 13 Apr 2015 19:50:33 +0000 (+0100) Subject: * lisp/emacs-lisp/package.el: Fix package--ensure-init-file X-Git-Tag: emacs-25.0.90~2440 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2bad549b954ccd659d8db58cf1e42e257496803b;p=emacs.git * lisp/emacs-lisp/package.el: Fix package--ensure-init-file --- 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))