comparison src/eval.c @ 5566:e2925466c923

(Fsignal): Rename 1st arg to error_symbol.
author Richard M. Stallman <rms@gnu.org>
date Tue, 11 Jan 1994 19:06:40 +0000
parents 50ada322de3e
children c61f49e4283a
comparison
equal deleted inserted replaced
5565:8b688d642fc1 5566:e2925466c923
1092 } 1092 }
1093 1093
1094 static Lisp_Object find_handler_clause (); 1094 static Lisp_Object find_handler_clause ();
1095 1095
1096 DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0, 1096 DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
1097 "Signal an error. Args are SIGNAL-NAME, and associated DATA.\n\ 1097 "Signal an error. Args are ERROR-SYMBOL and associated DATA.\n\
1098 This function does not return.\n\n\ 1098 This function does not return.\n\n\
1099 A signal name is a symbol with an `error-conditions' property\n\ 1099 An error symbol is a symbol with an `error-conditions' property\n\
1100 that is a list of condition names.\n\ 1100 that is a list of condition names.\n\
1101 A handler for any of those names will get to handle this signal.\n\ 1101 A handler for any of those names will get to handle this signal.\n\
1102 The symbol `error' should normally be one of them.\n\ 1102 The symbol `error' should normally be one of them.\n\
1103 \n\ 1103 \n\
1104 DATA should be a list. Its elements are printed as part of the error message.\n\ 1104 DATA should be a list. Its elements are printed as part of the error message.\n\
1105 If the signal is handled, DATA is made available to the handler.\n\ 1105 If the signal is handled, DATA is made available to the handler.\n\
1106 See also the function `condition-case'.") 1106 See also the function `condition-case'.")
1107 (sig, data) 1107 (error_symbol, data)
1108 Lisp_Object sig, data; 1108 Lisp_Object error_symbol, data;
1109 { 1109 {
1110 register struct handler *allhandlers = handlerlist; 1110 register struct handler *allhandlers = handlerlist;
1111 Lisp_Object conditions; 1111 Lisp_Object conditions;
1112 extern int gc_in_progress; 1112 extern int gc_in_progress;
1113 extern int waiting_for_input; 1113 extern int waiting_for_input;
1120 1120
1121 #ifdef HAVE_X_WINDOWS 1121 #ifdef HAVE_X_WINDOWS
1122 TOTALLY_UNBLOCK_INPUT; 1122 TOTALLY_UNBLOCK_INPUT;
1123 #endif 1123 #endif
1124 1124
1125 conditions = Fget (sig, Qerror_conditions); 1125 conditions = Fget (error_symbol, Qerror_conditions);
1126 1126
1127 for (; handlerlist; handlerlist = handlerlist->next) 1127 for (; handlerlist; handlerlist = handlerlist->next)
1128 { 1128 {
1129 register Lisp_Object clause; 1129 register Lisp_Object clause;
1130 clause = find_handler_clause (handlerlist->handler, conditions, 1130 clause = find_handler_clause (handlerlist->handler, conditions,
1131 sig, data, &debugger_value); 1131 error_symbol, data, &debugger_value);
1132 1132
1133 #if 0 /* Most callers are not prepared to handle gc if this returns. 1133 #if 0 /* Most callers are not prepared to handle gc if this returns.
1134 So, since this feature is not very useful, take it out. */ 1134 So, since this feature is not very useful, take it out. */
1135 /* If have called debugger and user wants to continue, 1135 /* If have called debugger and user wants to continue,
1136 just return nil. */ 1136 just return nil. */
1139 #else 1139 #else
1140 if (EQ (clause, Qlambda)) 1140 if (EQ (clause, Qlambda))
1141 { 1141 {
1142 /* We can't return values to code which signalled an error, but we 1142 /* We can't return values to code which signalled an error, but we
1143 can continue code which has signalled a quit. */ 1143 can continue code which has signalled a quit. */
1144 if (EQ (sig, Qquit)) 1144 if (EQ (error_symbol, Qquit))
1145 return Qnil; 1145 return Qnil;
1146 else 1146 else
1147 error ("Cannot return from the debugger in an error"); 1147 error ("Cannot return from the debugger in an error");
1148 } 1148 }
1149 #endif 1149 #endif
1150 1150
1151 if (!NILP (clause)) 1151 if (!NILP (clause))
1152 { 1152 {
1153 struct handler *h = handlerlist; 1153 struct handler *h = handlerlist;
1154 handlerlist = allhandlers; 1154 handlerlist = allhandlers;
1155 unwind_to_catch (h->tag, Fcons (clause, Fcons (sig, data))); 1155 unwind_to_catch (h->tag, Fcons (clause, Fcons (error_symbol, data)));
1156 } 1156 }
1157 } 1157 }
1158 1158
1159 handlerlist = allhandlers; 1159 handlerlist = allhandlers;
1160 /* If no handler is present now, try to run the debugger, 1160 /* If no handler is present now, try to run the debugger,
1161 and if that fails, throw to top level. */ 1161 and if that fails, throw to top level. */
1162 find_handler_clause (Qerror, conditions, sig, data, &debugger_value); 1162 find_handler_clause (Qerror, conditions, error_symbol, data, &debugger_value);
1163 Fthrow (Qtop_level, Qt); 1163 Fthrow (Qtop_level, Qt);
1164 } 1164 }
1165 1165
1166 /* Return nonzero iff LIST is a non-nil atom or 1166 /* Return nonzero iff LIST is a non-nil atom or
1167 a list containing one of CONDITIONS. */ 1167 a list containing one of CONDITIONS. */