summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-01-01 12:14:05 -0500
committerChong Yidong <cyd@stupidchicken.com>2010-01-01 12:14:05 -0500
commit8932b1c23656efbb76e0fc60d845c8b854cf509a (patch)
treeafffc5f7cc9891300ff616bf0f7e87f6e8ca8fb2 /src/eval.c
parent829f35a5bb1a68526a3175542bad177420df1e1d (diff)
downloademacs-8932b1c23656efbb76e0fc60d845c8b854cf509a.tar.gz
emacs-8932b1c23656efbb76e0fc60d845c8b854cf509a.tar.bz2
emacs-8932b1c23656efbb76e0fc60d845c8b854cf509a.zip
* eval.c (run_hook_with_args): Handle the case where the global
value has the obsolete single-function form (Bug#5026).
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c
index 1c975003318..0198fb7c131 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2620,7 +2620,6 @@ run_hook_with_args (nargs, args, cond)
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,
@@ -2641,7 +2640,7 @@ run_hook_with_args (nargs, args, cond)
}
else
{
- globals = Qnil;
+ Lisp_Object globals = Qnil;
GCPRO3 (sym, val, globals);
for (;
@@ -2654,18 +2653,28 @@ run_hook_with_args (nargs, args, cond)
{
/* 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