summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2014-07-08 12:17:09 +0300
committerJuri Linkov <juri@jurta.org>2014-07-08 12:17:09 +0300
commit7acd41f38f21b03dd73256e7ef5a7db2c733df00 (patch)
tree879ab25f3f79ef607310b1406af6f30713e0e668 /lisp
parent6dc311adc3908257011bd9d21426a5d4d92616eb (diff)
downloademacs-7acd41f38f21b03dd73256e7ef5a7db2c733df00.tar.gz
* lisp/startup.el (command-line): Append displaying the warning about
the errors in the init file to the end of `after-init-hook'. Fixes: debbugs:17927
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/startup.el25
2 files changed, 22 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d346ac65def..13cb52acc1c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
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
when it's not a symbol.
(x-resolve-font-name): Don't check if the face is a symbol.
diff --git a/lisp/startup.el b/lisp/startup.el
index 2f1d9af1cf1..a229207a2c8 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -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)