package--ensure-init-file: widen requires save-restriction

This commit is contained in:
Sam Steingold 2015-04-14 15:14:20 -04:00
parent 95cee7f6a6
commit e45dbdc386

View file

@ -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))