summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-07-08 19:04:12 -0700
committerGlenn Morris <rgm@gnu.org>2014-07-08 19:04:12 -0700
commit5613a6f6d52bca0018c5777aba67a99f51016a35 (patch)
treec070100c79442ae2f9876f82af4eeebadc39249c /lisp/startup.el
parent27e81f9f4e368176a3b17ceeadd2e0aa5dd9d1ed (diff)
parentd8899d09b992d733dc1cc6ec93b11cb75ce84f5d (diff)
downloademacs-5613a6f6d52bca0018c5777aba67a99f51016a35.tar.gz
Merge from emacs-24; up to 2014-06-19T14:03:45Z!monnier@iro.umontreal.ca
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index aa448848cea..d984e6269ae 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1182,18 +1182,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)