Commit fecd1557 authored by Artur Malabarba's avatar Artur Malabarba

* lisp/emacs-lisp/package.el: Skip space and comments in init file

(package--ensure-init-file): Insert snippet at first
non-whitespace non-comments line.  Respects local-vars at the top
of the file.
parent f660f360
......@@ -1813,6 +1813,7 @@ using `package-compute-transaction'."
(goto-char (point-min))
(search-forward "(package-initialize)" nil 'noerror))))
;; Don't visit the file if we don't have to.
(insert-file-contents user-init-file)
(goto-char (point-min))
......@@ -1825,7 +1826,11 @@ using `package-compute-transaction'."
(goto-char (point-min))
(while (and (looking-at-p "[[:blank:]]*\\(;\\|$\\)")
(not (eobp)))
(forward-line 1))
";; Added by Package.el. This must come before configurations of\n"
";; installed packages. Don't delete this line. If you don't want it,\n"
";; just comment it out by adding a semicolon to the start of the line.\n"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment