]> git.eshelyaron.com Git - emacs.git/commitdiff
Use delay-mode-hooks when visiting the init-file
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 12 Apr 2015 13:37:45 +0000 (14:37 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 12 Apr 2015 15:16:06 +0000 (16:16 +0100)
* lisp/emacs-lisp/package.el (package--ensure-init-file):
delay-mode-hooks

* lisp/cus-edit.el (custom-save-all): delay-mode-hooks

lisp/cus-edit.el
lisp/emacs-lisp/package.el

index f56fb6a649e26e84b80449d5764c34fd66bab57d..9cc2fa81d075c551196f0cef39be7aeb5156d94e 100644 (file)
@@ -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))
index ded2faa54f63bec2ca2840baeff12b3606c9e457..bdb2cc034950b8f35cf3cdca4f234b34a94e8c46 100644 (file)
@@ -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)