enum run_hooks_condition cond;
{
Lisp_Object sym, val, ret;
- Lisp_Object globals;
struct gcpro gcpro1, gcpro2, gcpro3;
/* If we are dying or still initializing,
}
else
{
- globals = Qnil;
+ Lisp_Object globals = Qnil;
GCPRO3 (sym, val, globals);
for (;
{
/* t indicates this hook has a local binding;
it means to run the global binding too. */
+ globals = Fdefault_value (sym);
+ if (NILP (globals)) continue;
- for (globals = Fdefault_value (sym);
- CONSP (globals) && ((cond == to_completion)
- || (cond == until_success ? NILP (ret)
- : !NILP (ret)));
- globals = XCDR (globals))
+ if (!CONSP (globals) || EQ (XCAR (globals), Qlambda))
+ {
+ args[0] = globals;
+ ret = Ffuncall (nargs, args);
+ }
+ else
{
- args[0] = XCAR (globals);
- /* In a global value, t should not occur. If it does, we
- must ignore it to avoid an endless loop. */
- if (!EQ (args[0], Qt))
- ret = Ffuncall (nargs, args);
+ for (;
+ CONSP (globals) && ((cond == to_completion)
+ || (cond == until_success ? NILP (ret)
+ : !NILP (ret)));
+ globals = XCDR (globals))
+ {
+ args[0] = XCAR (globals);
+ /* In a global value, t should not occur. If it does, we
+ must ignore it to avoid an endless loop. */
+ if (!EQ (args[0], Qt))
+ ret = Ffuncall (nargs, args);
+ }
}
}
else