emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117362: * lisp/startup.el (command-line): Append


From: Juri Linkov
Subject: [Emacs-diffs] emacs-24 r117362: * lisp/startup.el (command-line): Append displaying the warning about
Date: Tue, 08 Jul 2014 09:17:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117362
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17927
committer: Juri Linkov <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-07-08 12:17:09 +0300
message:
  * lisp/startup.el (command-line): Append displaying the warning about
  the errors in the init file to the end of `after-init-hook'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/startup.el                startup.el-20091113204419-o5vbwnq5f7feedwu-260
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-07-08 09:03:23 +0000
+++ b/lisp/ChangeLog    2014-07-08 09:17:09 +0000
@@ -1,5 +1,11 @@
 2014-07-08  Juri Linkov  <address@hidden>
 
+       * 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  <address@hidden>
+
        * faces.el (face-name): Return input arg `face' as is
        when it's not a symbol.
        (x-resolve-font-name): Don't check if the face is a symbol.

=== modified file 'lisp/startup.el'
--- a/lisp/startup.el   2014-06-08 17:46:51 +0000
+++ b/lisp/startup.el   2014-07-08 09:17:09 +0000
@@ -1183,18 +1183,25 @@
                (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]