From: Sam Steingold Date: Tue, 14 Apr 2015 19:14:20 +0000 (-0400) Subject: package--ensure-init-file: widen requires save-restriction X-Git-Tag: emacs-25.0.90~2423 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e45dbdc386e08c0733cfc6d3cd7e574d8474b249;p=emacs.git package--ensure-init-file: widen requires save-restriction --- 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))