diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 1 | ||||
| -rw-r--r-- | src/eval.c | 34 |
2 files changed, 19 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 00361255651..0ef92dbb53a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | (Fdefvar): Rewrite so as not to use empty "else". | 7 | (Fdefvar): Rewrite so as not to use empty "else". |
| 8 | (lisp_indirect_variable): Name an expression, | 8 | (lisp_indirect_variable): Name an expression, |
| 9 | to avoid gcc -Wbad-function-cast warning. | 9 | to avoid gcc -Wbad-function-cast warning. |
| 10 | (Fdefvar): Rename locals to avoid shadowing. | ||
| 10 | 11 | ||
| 11 | * callint.c (quotify_arg, quotify_args): Now static. | 12 | * callint.c (quotify_arg, quotify_args): Now static. |
| 12 | (Fcall_interactively): Rename locals to avoid shadowing. | 13 | (Fcall_interactively): Rename locals to avoid shadowing. |
diff --git a/src/eval.c b/src/eval.c index affafadfecf..f68274e6e8c 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -764,11 +764,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 764 | if (SYMBOL_CONSTANT_P (sym)) | 764 | if (SYMBOL_CONSTANT_P (sym)) |
| 765 | { | 765 | { |
| 766 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ | 766 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ |
| 767 | Lisp_Object tem = Fcar (tail); | 767 | Lisp_Object tem1 = Fcar (tail); |
| 768 | if (! (CONSP (tem) | 768 | if (! (CONSP (tem1) |
| 769 | && EQ (XCAR (tem), Qquote) | 769 | && EQ (XCAR (tem1), Qquote) |
| 770 | && CONSP (XCDR (tem)) | 770 | && CONSP (XCDR (tem1)) |
| 771 | && EQ (XCAR (XCDR (tem)), sym))) | 771 | && EQ (XCAR (XCDR (tem1)), sym))) |
| 772 | error ("Constant symbol `%s' specified in defvar", | 772 | error ("Constant symbol `%s' specified in defvar", |
| 773 | SDATA (SYMBOL_NAME (sym))); | 773 | SDATA (SYMBOL_NAME (sym))); |
| 774 | } | 774 | } |
| @@ -2539,8 +2539,8 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2539 | } | 2539 | } |
| 2540 | else | 2540 | else |
| 2541 | { | 2541 | { |
| 2542 | Lisp_Object globals = Qnil; | 2542 | Lisp_Object global_vals = Qnil; |
| 2543 | GCPRO3 (sym, val, globals); | 2543 | GCPRO3 (sym, val, global_vals); |
| 2544 | 2544 | ||
| 2545 | for (; | 2545 | for (; |
| 2546 | CONSP (val) && ((cond == to_completion) | 2546 | CONSP (val) && ((cond == to_completion) |
| @@ -2552,23 +2552,25 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2552 | { | 2552 | { |
| 2553 | /* t indicates this hook has a local binding; | 2553 | /* t indicates this hook has a local binding; |
| 2554 | it means to run the global binding too. */ | 2554 | it means to run the global binding too. */ |
| 2555 | globals = Fdefault_value (sym); | 2555 | global_vals = Fdefault_value (sym); |
| 2556 | if (NILP (globals)) continue; | 2556 | if (NILP (global_vals)) continue; |
| 2557 | 2557 | ||
| 2558 | if (!CONSP (globals) || EQ (XCAR (globals), Qlambda)) | 2558 | if (!CONSP (global_vals) || EQ (XCAR (global_vals), Qlambda)) |
| 2559 | { | 2559 | { |
| 2560 | args[0] = globals; | 2560 | args[0] = global_vals; |
| 2561 | ret = Ffuncall (nargs, args); | 2561 | ret = Ffuncall (nargs, args); |
| 2562 | } | 2562 | } |
| 2563 | else | 2563 | else |
| 2564 | { | 2564 | { |
| 2565 | for (; | 2565 | for (; |
| 2566 | CONSP (globals) && ((cond == to_completion) | 2566 | (CONSP (global_vals) |
| 2567 | || (cond == until_success ? NILP (ret) | 2567 | && (cond == to_completion |
| 2568 | : !NILP (ret))); | 2568 | || (cond == until_success |
| 2569 | globals = XCDR (globals)) | 2569 | ? NILP (ret) |
| 2570 | : !NILP (ret)))); | ||
| 2571 | global_vals = XCDR (global_vals)) | ||
| 2570 | { | 2572 | { |
| 2571 | args[0] = XCAR (globals); | 2573 | args[0] = XCAR (global_vals); |
| 2572 | /* In a global value, t should not occur. If it does, we | 2574 | /* In a global value, t should not occur. If it does, we |
| 2573 | must ignore it to avoid an endless loop. */ | 2575 | must ignore it to avoid an endless loop. */ |
| 2574 | if (!EQ (args[0], Qt)) | 2576 | if (!EQ (args[0], Qt)) |