summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/package.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r--lisp/emacs-lisp/package.el4
1 files changed, 3 insertions, 1 deletions
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))