diff options
| author | Richard M. Stallman | 1993-12-31 03:45:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-31 03:45:38 +0000 |
| commit | 3d1b78f027818dbde31a7ccca0e5b8bc4c76e155 (patch) | |
| tree | 3f1cf21738aee3c8a1d363912b1607025c66a7f6 | |
| parent | 657a790941c2074501634e2d278225af0d729d1d (diff) | |
| download | emacs-3d1b78f027818dbde31a7ccca0e5b8bc4c76e155.tar.gz emacs-3d1b78f027818dbde31a7ccca0e5b8bc4c76e155.zip | |
(command-line): In most cases, if init file sets
debug-on-error, leave it set that way.
| -rw-r--r-- | lisp/startup.el | 69 |
1 files changed, 40 insertions, 29 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 7ba3a017b73..ea5a1651d51 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -252,35 +252,46 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.") | |||
| 252 | (setq inhibit-startup-message nil) | 252 | (setq inhibit-startup-message nil) |
| 253 | 253 | ||
| 254 | ;; Load that user's init file, or the default one, or none. | 254 | ;; Load that user's init file, or the default one, or none. |
| 255 | (let ((debug-on-error init-file-debug) | 255 | (let (debug-on-error-from-init-file |
| 256 | ;; This function actually reads the init files. | 256 | debug-on-error-should-be-set |
| 257 | (inner | 257 | (debug-on-error-initial |
| 258 | (function | 258 | (if (eq init-file-debug t) 'startup init-file-debug))) |
| 259 | (lambda () | 259 | (let ((debug-on-error debug-on-error-initial) |
| 260 | (if init-file-user | 260 | ;; This function actually reads the init files. |
| 261 | (progn (load (if (eq system-type 'vax-vms) | 261 | (inner |
| 262 | "sys$login:.emacs" | 262 | (function |
| 263 | (concat "~" init-file-user "/.emacs")) | 263 | (lambda () |
| 264 | t t t) | 264 | (if init-file-user |
| 265 | (or inhibit-default-init | 265 | (progn (load (if (eq system-type 'vax-vms) |
| 266 | (let ((inhibit-startup-message nil)) | 266 | "sys$login:.emacs" |
| 267 | ;; Users are supposed to be told their rights. | 267 | (concat "~" init-file-user "/.emacs")) |
| 268 | ;; (Plus how to get help and how to undo.) | 268 | t t t) |
| 269 | ;; Don't you dare turn this off for anyone | 269 | (or inhibit-default-init |
| 270 | ;; except yourself. | 270 | (let ((inhibit-startup-message nil)) |
| 271 | (load "default" t t))))))))) | 271 | ;; Users are supposed to be told their rights. |
| 272 | (if init-file-debug | 272 | ;; (Plus how to get help and how to undo.) |
| 273 | ;; Do this without a condition-case if the user wants to debug. | 273 | ;; Don't you dare turn this off for anyone |
| 274 | (funcall inner) | 274 | ;; except yourself. |
| 275 | (condition-case error | 275 | (load "default" t t))))))))) |
| 276 | (progn | 276 | (if init-file-debug |
| 277 | (funcall inner) | 277 | ;; Do this without a condition-case if the user wants to debug. |
| 278 | (setq init-file-had-error nil)) | 278 | (funcall inner) |
| 279 | (error (message "Error in init file: %s%s%s" | 279 | (condition-case error |
| 280 | (get (car error) 'error-message) | 280 | (progn |
| 281 | (if (cdr error) ": ") | 281 | (funcall inner) |
| 282 | (mapconcat 'prin1-to-string (cdr error) ", ")) | 282 | (setq init-file-had-error nil)) |
| 283 | (setq init-file-had-error t))))) | 283 | (error (message "Error in init file: %s%s%s" |
| 284 | (get (car error) 'error-message) | ||
| 285 | (if (cdr error) ": ") | ||
| 286 | (mapconcat 'prin1-to-string (cdr error) ", ")) | ||
| 287 | (setq init-file-had-error t)))) | ||
| 288 | ;; If we can tell that the init file altered debug-on-error., | ||
| 289 | ;; arrange to preserve the value that it set up. | ||
| 290 | (or (eq debug-on-error debug-on-error-initial) | ||
| 291 | (setq debug-on-error-should-be-set t | ||
| 292 | debug-on-error-from-init-file debug-on-error))) | ||
| 293 | (if debug-on-error-should-be-set | ||
| 294 | (setq debug-on-error debug-on-error-from-init-file))) | ||
| 284 | 295 | ||
| 285 | (run-hooks 'after-init-hook) | 296 | (run-hooks 'after-init-hook) |
| 286 | 297 | ||