]> git.eshelyaron.com Git - emacs.git/commitdiff
package--ensure-init-file: widen requires save-restriction
authorSam Steingold <sds@gnu.org>
Tue, 14 Apr 2015 19:14:20 +0000 (15:14 -0400)
committerSam Steingold <sds@gnu.org>
Tue, 14 Apr 2015 19:14:20 +0000 (15:14 -0400)
lisp/emacs-lisp/package.el

index dd1c5dfc056c9d5ebfc78056385db36e35e17652..2fb54f0d944ba7f78bd8d7ef09f96b1b786e4df9 100644 (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))