diff options
| author | Artur Malabarba | 2015-04-12 14:37:45 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-04-12 16:16:06 +0100 |
| commit | dfdd7e19446d5fbdbf2211d5ef80ac34655b9f30 (patch) | |
| tree | b6e8b708565a7f8dab329fd50b086fe470cf33a1 | |
| parent | 5fb807efcd6dda113c0cfade9811070e45c36a2f (diff) | |
| download | emacs-dfdd7e19446d5fbdbf2211d5ef80ac34655b9f30.tar.gz emacs-dfdd7e19446d5fbdbf2211d5ef80ac34655b9f30.zip | |
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
| -rw-r--r-- | lisp/cus-edit.el | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index f56fb6a649e..9cc2fa81d07 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -4406,7 +4406,9 @@ if only the first line of the docstring is shown.")) | |||
| 4406 | old-buffer-name) | 4406 | old-buffer-name) |
| 4407 | 4407 | ||
| 4408 | (with-current-buffer (let ((find-file-visit-truename t)) | 4408 | (with-current-buffer (let ((find-file-visit-truename t)) |
| 4409 | (or old-buffer (find-file-noselect filename))) | 4409 | (or old-buffer |
| 4410 | (let ((delay-mode-hooks t)) | ||
| 4411 | (find-file-noselect filename)))) | ||
| 4410 | ;; We'll save using file-precious-flag, so avoid destroying | 4412 | ;; We'll save using file-precious-flag, so avoid destroying |
| 4411 | ;; symlinks. (If we're not already visiting the buffer, this is | 4413 | ;; symlinks. (If we're not already visiting the buffer, this is |
| 4412 | ;; handled by find-file-visit-truename, above.) | 4414 | ;; handled by find-file-visit-truename, above.) |
| @@ -4415,7 +4417,7 @@ if only the first line of the docstring is shown.")) | |||
| 4415 | (set-visited-file-name (file-chase-links filename))) | 4417 | (set-visited-file-name (file-chase-links filename))) |
| 4416 | 4418 | ||
| 4417 | (unless (eq major-mode 'emacs-lisp-mode) | 4419 | (unless (eq major-mode 'emacs-lisp-mode) |
| 4418 | (emacs-lisp-mode)) | 4420 | (delay-mode-hooks (emacs-lisp-mode))) |
| 4419 | (let ((inhibit-read-only t) | 4421 | (let ((inhibit-read-only t) |
| 4420 | (print-length nil) | 4422 | (print-length nil) |
| 4421 | (print-level nil)) | 4423 | (print-level nil)) |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ded2faa54f6..bdb2cc03495 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -1778,7 +1778,9 @@ using `package-compute-transaction'." | |||
| 1778 | (goto-char (point-min)) | 1778 | (goto-char (point-min)) |
| 1779 | (search-forward "(package-initialize)" nil 'noerror))))) | 1779 | (search-forward "(package-initialize)" nil 'noerror))))) |
| 1780 | (unless contains-init | 1780 | (unless contains-init |
| 1781 | (with-current-buffer (or buffer (find-file-noselect user-init-file)) | 1781 | (with-current-buffer (or buffer |
| 1782 | (let ((delay-mode-hooks t)) | ||
| 1783 | (find-file-noselect user-init-file))) | ||
| 1782 | (save-excursion | 1784 | (save-excursion |
| 1783 | (save-restriction | 1785 | (save-restriction |
| 1784 | (widen) | 1786 | (widen) |