]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/startup.el (command-line): Append displaying the warning about
authorJuri Linkov <juri@jurta.org>
Tue, 8 Jul 2014 09:17:09 +0000 (12:17 +0300)
committerJuri Linkov <juri@jurta.org>
Tue, 8 Jul 2014 09:17:09 +0000 (12:17 +0300)
the errors in the init file to the end of `after-init-hook'.

Fixes: debbugs:17927
lisp/ChangeLog
lisp/startup.el

index d346ac65def71fc24428adc7a87363c34d685824..13cb52acc1c43aef29eaafa7002a4952dc14eb5e 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-08  Juri Linkov  <juri@jurta.org>
+
+       * startup.el (command-line): Append displaying the warning about
+       the errors in the init file to the end of `after-init-hook'.
+       (Bug#17927)
+
 2014-07-08  Juri Linkov  <juri@jurta.org>
 
        * faces.el (face-name): Return input arg `face' as is
index 2f1d9af1cf1e6465ff638c07e7fedf6c4fc86fac..a229207a2c85f2096024909fd4ccf0b09d7f3de7 100644 (file)
@@ -1183,18 +1183,25 @@ please check its value")
                (funcall inner)
                (setq init-file-had-error nil))
            (error
-            (display-warning
-             'initialization
-             (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\
+            ;; Postpone displaying the warning until all hooks
+            ;; in `after-init-hook' like `desktop-read' will finalize
+            ;; possible changes in the window configuration.
+            (add-hook
+             'after-init-hook
+             (lambda ()
+               (display-warning
+                'initialization
+                (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\
 To ensure normal operation, you should investigate and remove the
 cause of the error in your initialization file.  Start Emacs with
 the `--debug-init' option to view a complete error backtrace."
-                     user-init-file
-                     (get (car error) 'error-message)
-                     (if (cdr error) ": " "")
-                     (mapconcat (lambda (s) (prin1-to-string s t))
-                                 (cdr error) ", "))
-             :warning)
+                        user-init-file
+                        (get (car error) 'error-message)
+                        (if (cdr error) ": " "")
+                        (mapconcat (lambda (s) (prin1-to-string s t))
+                                   (cdr error) ", "))
+                :warning))
+             t)
             (setq init-file-had-error t))))
 
       (if (and deactivate-mark transient-mark-mode)