Commit dfdd7e19 authored by Artur Malabarba's avatar Artur Malabarba

Use delay-mode-hooks when visiting the init-file

* lisp/emacs-lisp/package.el (package--ensure-init-file):
delay-mode-hooks

* lisp/cus-edit.el (custom-save-all): delay-mode-hooks
parent 5fb807ef
......@@ -4406,7 +4406,9 @@ if only the first line of the docstring is shown."))
old-buffer-name)
(with-current-buffer (let ((find-file-visit-truename t))
(or old-buffer (find-file-noselect filename)))
(or old-buffer
(let ((delay-mode-hooks t))
(find-file-noselect filename))))
;; We'll save using file-precious-flag, so avoid destroying
;; symlinks. (If we're not already visiting the buffer, this is
;; handled by find-file-visit-truename, above.)
......@@ -4415,7 +4417,7 @@ if only the first line of the docstring is shown."))
(set-visited-file-name (file-chase-links filename)))
(unless (eq major-mode 'emacs-lisp-mode)
(emacs-lisp-mode))
(delay-mode-hooks (emacs-lisp-mode)))
(let ((inhibit-read-only t)
(print-length nil)
(print-level nil))
......
......@@ -1778,7 +1778,9 @@ using `package-compute-transaction'."
(goto-char (point-min))
(search-forward "(package-initialize)" nil 'noerror)))))
(unless contains-init
(with-current-buffer (or buffer (find-file-noselect user-init-file))
(with-current-buffer (or buffer
(let ((delay-mode-hooks t))
(find-file-noselect user-init-file)))
(save-excursion
(save-restriction
(widen)
......
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