# HG changeset patch # User Chong Yidong # Date 1262366045 18000 # Node ID 554599f8828c4b899d62b8bc29c24720dff36b97 # Parent 8c60b70f95054fe8abefe71a9d6fdb5b00694321 * eval.c (run_hook_with_args): Handle the case where the global value has the obsolete single-function form (Bug#5026). diff -r 8c60b70f9505 -r 554599f8828c src/ChangeLog --- a/src/ChangeLog Wed Dec 30 21:14:46 2009 -0500 +++ b/src/ChangeLog Fri Jan 01 12:14:05 2010 -0500 @@ -1,3 +1,8 @@ +2010-01-01 Chong Yidong + + * eval.c (run_hook_with_args): Handle the case where the global + value has the obsolete single-function form (Bug#5026). + 2009-12-27 Chong Yidong * minibuf.c (Fall_completions): Minor optimization. diff -r 8c60b70f9505 -r 554599f8828c src/eval.c --- a/src/eval.c Wed Dec 30 21:14:46 2009 -0500 +++ b/src/eval.c Fri Jan 01 12:14:05 2010 -0500 @@ -2620,7 +2620,6 @@ 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 @@ } else { - globals = Qnil; + Lisp_Object globals = Qnil; GCPRO3 (sym, val, globals); for (; @@ -2654,18 +2653,28 @@ { /* t indicates this hook has a local binding; it means to run the global binding too. */ - - for (globals = Fdefault_value (sym); - CONSP (globals) && ((cond == to_completion) - || (cond == until_success ? NILP (ret) - : !NILP (ret))); - globals = XCDR (globals)) + globals = Fdefault_value (sym); + if (NILP (globals)) continue; + + 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