diff options
| author | Juri Linkov | 2014-07-08 12:17:09 +0300 |
|---|---|---|
| committer | Juri Linkov | 2014-07-08 12:17:09 +0300 |
| commit | 7acd41f38f21b03dd73256e7ef5a7db2c733df00 (patch) | |
| tree | 879ab25f3f79ef607310b1406af6f30713e0e668 | |
| parent | 6dc311adc3908257011bd9d21426a5d4d92616eb (diff) | |
| download | emacs-7acd41f38f21b03dd73256e7ef5a7db2c733df00.tar.gz emacs-7acd41f38f21b03dd73256e7ef5a7db2c733df00.zip | |
* 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
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/startup.el | 25 |
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 @@ | |||
| 1 | 2014-07-08 Juri Linkov <juri@jurta.org> | 1 | 2014-07-08 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * startup.el (command-line): Append displaying the warning about | ||
| 4 | the errors in the init file to the end of `after-init-hook'. | ||
| 5 | (Bug#17927) | ||
| 6 | |||
| 7 | 2014-07-08 Juri Linkov <juri@jurta.org> | ||
| 8 | |||
| 3 | * faces.el (face-name): Return input arg `face' as is | 9 | * faces.el (face-name): Return input arg `face' as is |
| 4 | when it's not a symbol. | 10 | when it's not a symbol. |
| 5 | (x-resolve-font-name): Don't check if the face is a symbol. | 11 | (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") | |||
| 1183 | (funcall inner) | 1183 | (funcall inner) |
| 1184 | (setq init-file-had-error nil)) | 1184 | (setq init-file-had-error nil)) |
| 1185 | (error | 1185 | (error |
| 1186 | (display-warning | 1186 | ;; Postpone displaying the warning until all hooks |
| 1187 | 'initialization | 1187 | ;; in `after-init-hook' like `desktop-read' will finalize |
| 1188 | (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\ | 1188 | ;; possible changes in the window configuration. |
| 1189 | (add-hook | ||
| 1190 | 'after-init-hook | ||
| 1191 | (lambda () | ||
| 1192 | (display-warning | ||
| 1193 | 'initialization | ||
| 1194 | (format "An error occurred while loading `%s':\n\n%s%s%s\n\n\ | ||
| 1189 | To ensure normal operation, you should investigate and remove the | 1195 | To ensure normal operation, you should investigate and remove the |
| 1190 | cause of the error in your initialization file. Start Emacs with | 1196 | cause of the error in your initialization file. Start Emacs with |
| 1191 | the `--debug-init' option to view a complete error backtrace." | 1197 | the `--debug-init' option to view a complete error backtrace." |
| 1192 | user-init-file | 1198 | user-init-file |
| 1193 | (get (car error) 'error-message) | 1199 | (get (car error) 'error-message) |
| 1194 | (if (cdr error) ": " "") | 1200 | (if (cdr error) ": " "") |
| 1195 | (mapconcat (lambda (s) (prin1-to-string s t)) | 1201 | (mapconcat (lambda (s) (prin1-to-string s t)) |
| 1196 | (cdr error) ", ")) | 1202 | (cdr error) ", ")) |
| 1197 | :warning) | 1203 | :warning)) |
| 1204 | t) | ||
| 1198 | (setq init-file-had-error t)))) | 1205 | (setq init-file-had-error t)))) |
| 1199 | 1206 | ||
| 1200 | (if (and deactivate-mark transient-mark-mode) | 1207 | (if (and deactivate-mark transient-mark-mode) |