From e45dbdc386e08c0733cfc6d3cd7e574d8474b249 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Tue, 14 Apr 2015 15:14:20 -0400 Subject: [PATCH] package--ensure-init-file: widen requires save-restriction --- lisp/emacs-lisp/package.el | 7 ++++--- 1 file 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)) -- 2.39.2