diff options
| author | Chong Yidong | 2010-01-01 12:14:05 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-01-01 12:14:05 -0500 |
| commit | 8932b1c23656efbb76e0fc60d845c8b854cf509a (patch) | |
| tree | afffc5f7cc9891300ff616bf0f7e87f6e8ca8fb2 /src/eval.c | |
| parent | 829f35a5bb1a68526a3175542bad177420df1e1d (diff) | |
| download | emacs-8932b1c23656efbb76e0fc60d845c8b854cf509a.tar.gz 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.c | 33 |
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) | |||
| 2620 | enum run_hooks_condition cond; | 2620 | enum run_hooks_condition cond; |
| 2621 | { | 2621 | { |
| 2622 | Lisp_Object sym, val, ret; | 2622 | Lisp_Object sym, val, ret; |
| 2623 | Lisp_Object globals; | ||
| 2624 | struct gcpro gcpro1, gcpro2, gcpro3; | 2623 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 2625 | 2624 | ||
| 2626 | /* If we are dying or still initializing, | 2625 | /* If we are dying or still initializing, |
| @@ -2641,7 +2640,7 @@ run_hook_with_args (nargs, args, cond) | |||
| 2641 | } | 2640 | } |
| 2642 | else | 2641 | else |
| 2643 | { | 2642 | { |
| 2644 | globals = Qnil; | 2643 | Lisp_Object globals = Qnil; |
| 2645 | GCPRO3 (sym, val, globals); | 2644 | GCPRO3 (sym, val, globals); |
| 2646 | 2645 | ||
| 2647 | for (; | 2646 | for (; |
| @@ -2654,18 +2653,28 @@ run_hook_with_args (nargs, args, cond) | |||
| 2654 | { | 2653 | { |
| 2655 | /* t indicates this hook has a local binding; | 2654 | /* t indicates this hook has a local binding; |
| 2656 | it means to run the global binding too. */ | 2655 | it means to run the global binding too. */ |
| 2656 | globals = Fdefault_value (sym); | ||
| 2657 | if (NILP (globals)) continue; | ||
| 2657 | 2658 | ||
| 2658 | for (globals = Fdefault_value (sym); | 2659 | if (!CONSP (globals) || EQ (XCAR (globals), Qlambda)) |
| 2659 | CONSP (globals) && ((cond == to_completion) | 2660 | { |
| 2660 | || (cond == until_success ? NILP (ret) | 2661 | args[0] = globals; |
| 2661 | : !NILP (ret))); | 2662 | ret = Ffuncall (nargs, args); |
| 2662 | globals = XCDR (globals)) | 2663 | } |
| 2664 | else | ||
| 2663 | { | 2665 | { |
| 2664 | args[0] = XCAR (globals); | 2666 | for (; |
| 2665 | /* In a global value, t should not occur. If it does, we | 2667 | CONSP (globals) && ((cond == to_completion) |
| 2666 | must ignore it to avoid an endless loop. */ | 2668 | || (cond == until_success ? NILP (ret) |
| 2667 | if (!EQ (args[0], Qt)) | 2669 | : !NILP (ret))); |
| 2668 | ret = Ffuncall (nargs, args); | 2670 | globals = XCDR (globals)) |
| 2671 | { | ||
| 2672 | args[0] = XCAR (globals); | ||
| 2673 | /* In a global value, t should not occur. If it does, we | ||
| 2674 | must ignore it to avoid an endless loop. */ | ||
| 2675 | if (!EQ (args[0], Qt)) | ||
| 2676 | ret = Ffuncall (nargs, args); | ||
| 2677 | } | ||
| 2669 | } | 2678 | } |
| 2670 | } | 2679 | } |
| 2671 | else | 2680 | else |