]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/package.el: Fix package--ensure-init-file
authorArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 13 Apr 2015 19:50:33 +0000 (20:50 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 13 Apr 2015 19:51:14 +0000 (20:51 +0100)
lisp/emacs-lisp/package.el

index 6fb5ba45468a84655a70039f4a542443dc122564..f3333751606c57370cf9d3956dd611e3cde935cb 100644 (file)
@@ -1781,7 +1781,9 @@ using `package-compute-transaction'."
            (contains-init
             (if buffer
                 (with-current-buffer buffer
-                  (search-forward "(package-initialize)" nil 'noerror))
+                  (save-excursion
+                    (goto-char (point-min))
+                    (search-forward "(package-initialize)" nil 'noerror)))
               (with-temp-buffer
                 (insert-file-contents user-init-file)
                 (goto-char (point-min))