Commit 7acd41f3 authored by Juri Linkov's avatar Juri Linkov
Browse files

* 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
parent 6dc311ad
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> 2014-07-08 Juri Linkov <juri@jurta.org>
   
* faces.el (face-name): Return input arg `face' as is * faces.el (face-name): Return input arg `face' as is
......
...@@ -1183,18 +1183,25 @@ please check its value") ...@@ -1183,18 +1183,25 @@ please check its value")
(funcall inner) (funcall inner)
(setq init-file-had-error nil)) (setq init-file-had-error nil))
(error (error
(display-warning ;; Postpone displaying the warning until all hooks
'initialization ;; in `after-init-hook' like `desktop-read' will finalize
(format "An error occurred while loading `%s':\n\n%s%s%s\n\n\ ;; 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 To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace." the `--debug-init' option to view a complete error backtrace."
user-init-file user-init-file
(get (car error) 'error-message) (get (car error) 'error-message)
(if (cdr error) ": " "") (if (cdr error) ": " "")
(mapconcat (lambda (s) (prin1-to-string s t)) (mapconcat (lambda (s) (prin1-to-string s t))
(cdr error) ", ")) (cdr error) ", "))
:warning) :warning))
t)
(setq init-file-had-error t)))) (setq init-file-had-error t))))
(if (and deactivate-mark transient-mark-mode) (if (and deactivate-mark transient-mark-mode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment