comparison src/eval.c @ 878:5b1c5b4286e7

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 27 Jul 1992 02:56:28 +0000
parents 427299469901
children bf0e6122c2a9
comparison
equal deleted inserted replaced
877:e0dde8b90613 878:5b1c5b4286e7
1125 1125
1126 static int 1126 static int
1127 wants_debugger (list, conditions) 1127 wants_debugger (list, conditions)
1128 Lisp_Object list, conditions; 1128 Lisp_Object list, conditions;
1129 { 1129 {
1130 static int looking = 0;
1131
1132 if (looking)
1133 {
1134 /* We got an error while looking in LIST. */
1135 looking = 0;
1136 return 1;
1137 }
1138
1139 if (NILP (list)) 1130 if (NILP (list))
1140 return 0; 1131 return 0;
1141 if (! CONSP (list)) 1132 if (! CONSP (list))
1142 return 1; 1133 return 1;
1143 1134
1144 looking = 1; 1135 while (CONSP (conditions))
1145 while (!NILP (conditions)) 1136 {
1146 { 1137 Lisp_Object this, tail;
1147 Lisp_Object tem; 1138 this = XCONS (conditions)->car;
1148 tem = Fmemq (XCONS (conditions)->car, list); 1139 for (tail = list; CONSP (tail); tail = XCONS (tail)->cdr)
1149 if (! NILP (tem)) 1140 if (EQ (XCONS (tail)->car, this))
1150 {
1151 looking = 0;
1152 return 1; 1141 return 1;
1153 }
1154 conditions = XCONS (conditions)->cdr; 1142 conditions = XCONS (conditions)->cdr;
1155 } 1143 }
1144 return 0;
1156 } 1145 }
1157 1146
1158 /* Value of Qlambda means we have called debugger and user has continued. 1147 /* Value of Qlambda means we have called debugger and user has continued.
1159 Store value returned from debugger into *DEBUGGER_VALUE_PTR. */ 1148 Store value returned from debugger into *DEBUGGER_VALUE_PTR. */
1160 1149
1172 if (EQ (handlers, Qerror)) /* error is used similarly, but means display a backtrace too */ 1161 if (EQ (handlers, Qerror)) /* error is used similarly, but means display a backtrace too */
1173 { 1162 {
1174 if (wants_debugger (Vstack_trace_on_error, conditions)) 1163 if (wants_debugger (Vstack_trace_on_error, conditions))
1175 internal_with_output_to_temp_buffer ("*Backtrace*", Fbacktrace, Qnil); 1164 internal_with_output_to_temp_buffer ("*Backtrace*", Fbacktrace, Qnil);
1176 if (!entering_debugger 1165 if (!entering_debugger
1177 && ((EQ (sig, Qquit) && debug_on_quit) 1166 && (EQ (sig, Qquit) ? debug_on_quit
1178 || wants_debugger (Vdebug_on_error, conditions))) 1167 : wants_debugger (Vdebug_on_error, conditions)))
1179 { 1168 {
1180 int count = specpdl_ptr - specpdl; 1169 int count = specpdl_ptr - specpdl;
1181 specbind (Qdebug_on_error, Qnil); 1170 specbind (Qdebug_on_error, Qnil);
1182 *debugger_value_ptr = 1171 *debugger_value_ptr =
1183 call_debugger (Fcons (Qerror, 1172 call_debugger (Fcons (Qerror,