[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/raeburn-startup 6120138 12/17: Don't get into an e
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] scratch/raeburn-startup 6120138 12/17: Don't get into an error loop if dumped.elc isn't found. |
Date: |
Thu, 15 Dec 2016 11:33:18 +0000 (UTC) |
branch: scratch/raeburn-startup
commit 6120138143306490a8903cc0cb487fa7b771c050
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>
Don't get into an error loop if dumped.elc isn't found.
When temacs is run, if dumped.elc isn't in the right place (currently
$srctop/src/dumped.elc, though it's generated in the build tree's src
directory), starting in X11 mode will produce a message about not
finding it, but starting in tty mode will produce an error loop
because internal-echo-keystrokes-prefix isn't defined.
This patch traps the error and kills the Emacs session with an exit
code of 42, and no message. This is worse than the X11 behavior, but
better than the tty behavior.
It's not a long term fix though.
* src/emacs.c (main): If dumped.elc isn't found, exit with an error
code.
(syms_of_emacs): Define Qcondition_case.
---
src/emacs.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/emacs.c b/src/emacs.c
index 50e3abf..6a81194 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1655,8 +1655,19 @@ Using an Emacs configured with --with-x-toolkit=lucid
does not have this problem
Vtop_level = list2 (Qload, build_unibyte_string (file));
}
else if (! no_loadup)
- /* Unless next switch is -nl, load "loadup.el" first thing. */
- Vtop_level = list2 (Qload, build_string ("../src/dumped.elc"));
+ /* Unless next switch is -nl, load "dumped.elc" first thing.
+ If it fails, we won't be able to run. */
+ {
+ Lisp_Object load = list2 (Qload, build_string ("../src/dumped.elc"));
+ /* XXX We need a way for Lisp to cause Emacs to exit, with
+ an error message to stderr after restoring tty modes. */
+ /* (condition-case nil bodyform (file-missing (kill-emacs 42))) */
+ Vtop_level = list4 (Qcondition_case,
+ Qnil,
+ load,
+ list2 (Qfile_missing,
+ list2 (Qkill_emacs, make_number (42))));
+ }
}
/* Set up for profiling. This is known to work on FreeBSD,
@@ -2484,6 +2495,7 @@ syms_of_emacs (void)
DEFSYM (Qrisky_local_variable, "risky-local-variable");
DEFSYM (Qkill_emacs, "kill-emacs");
DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
+ DEFSYM (Qcondition_case, "condition-case");
#ifndef CANNOT_DUMP
defsubr (&Sdump_emacs);
- [Emacs-diffs] scratch/raeburn-startup 3dd6aa7 13/17: Create *Messages* buffer when loading dumped data., (continued)
- [Emacs-diffs] scratch/raeburn-startup 3dd6aa7 13/17: Create *Messages* buffer when loading dumped data., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup f48e12c 06/17: Reduce nested calls during substitution., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 702bcad 15/17: Don't memset storage we're about to fill anyway., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup c95f727 16/17: Dump defvars for special variables only., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8e7ec27 07/17: Use a hash table for seen_list, similar to read_objects_map., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup dcc4b55 04/17: Replace read_objects assoc list with two hash tables., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8f37b82 08/17: Stefan's patch to write out and load "dumped.elc"; Oct 31 version., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 872c9f6 05/17: Don't generate excessive hash tables during reads., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 44f3368 11/17: Force purification off when using dumped.elc., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 2fa607a 10/17: Increase the obarray size., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 6120138 12/17: Don't get into an error loop if dumped.elc isn't found.,
Ken Raeburn <=
- [Emacs-diffs] scratch/raeburn-startup 913592c 14/17: Optimize reading of ASCII symbols from a .elc file., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 5c337b4 01/17: Use getc_unlocked., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 6a7d996 17/17: Don't dump a copy of the obarray., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 4c8f07e 09/17: Increase gc-cons-threshold., Ken Raeburn, 2016/12/15