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.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index dd1c5dfc056..2fb54f0d944 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1782,9 +1782,10 @@ using `package-compute-transaction'."
(if buffer
(with-current-buffer buffer
(save-excursion
- (widen)
- (goto-char (point-min))
- (search-forward "(package-initialize)" nil 'noerror)))
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (search-forward "(package-initialize)" nil 'noerror))))
(with-temp-buffer
(insert-file-contents user-init-file)
(goto-char (point-min))