diff options
| author | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
| commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
| tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/eval.c | |
| parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
| parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
| download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip | |
Merge from trunk
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/eval.c b/src/eval.c index 2fb89ce404e..c22e7d3f571 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -160,7 +160,7 @@ restore_stack_limits (Lisp_Object data) | |||
| 160 | 160 | ||
| 161 | /* Call the Lisp debugger, giving it argument ARG. */ | 161 | /* Call the Lisp debugger, giving it argument ARG. */ |
| 162 | 162 | ||
| 163 | Lisp_Object | 163 | static Lisp_Object |
| 164 | call_debugger (Lisp_Object arg) | 164 | call_debugger (Lisp_Object arg) |
| 165 | { | 165 | { |
| 166 | int debug_while_redisplaying; | 166 | int debug_while_redisplaying; |
| @@ -216,7 +216,7 @@ call_debugger (Lisp_Object arg) | |||
| 216 | return unbind_to (count, val); | 216 | return unbind_to (count, val); |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | void | 219 | static void |
| 220 | do_debug_on_call (Lisp_Object code) | 220 | do_debug_on_call (Lisp_Object code) |
| 221 | { | 221 | { |
| 222 | debug_on_next_call = 0; | 222 | debug_on_next_call = 0; |
| @@ -796,11 +796,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 796 | if (SYMBOL_CONSTANT_P (sym)) | 796 | if (SYMBOL_CONSTANT_P (sym)) |
| 797 | { | 797 | { |
| 798 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ | 798 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ |
| 799 | Lisp_Object tem = Fcar (tail); | 799 | Lisp_Object tem1 = Fcar (tail); |
| 800 | if (! (CONSP (tem) | 800 | if (! (CONSP (tem1) |
| 801 | && EQ (XCAR (tem), Qquote) | 801 | && EQ (XCAR (tem1), Qquote) |
| 802 | && CONSP (XCDR (tem)) | 802 | && CONSP (XCDR (tem1)) |
| 803 | && EQ (XCAR (XCDR (tem)), sym))) | 803 | && EQ (XCAR (XCDR (tem1)), sym))) |
| 804 | error ("Constant symbol `%s' specified in defvar", | 804 | error ("Constant symbol `%s' specified in defvar", |
| 805 | SDATA (SYMBOL_NAME (sym))); | 805 | SDATA (SYMBOL_NAME (sym))); |
| 806 | } | 806 | } |
| @@ -840,11 +840,12 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 840 | Vinternal_interpreter_environment = | 840 | Vinternal_interpreter_environment = |
| 841 | Fcons (sym, Vinternal_interpreter_environment); | 841 | Fcons (sym, Vinternal_interpreter_environment); |
| 842 | else | 842 | else |
| 843 | /* Simple (defvar <var>) should not count as a definition at all. | 843 | { |
| 844 | It could get in the way of other definitions, and unloading this | 844 | /* Simple (defvar <var>) should not count as a definition at all. |
| 845 | package could try to make the variable unbound. */ | 845 | It could get in the way of other definitions, and unloading this |
| 846 | ; | 846 | package could try to make the variable unbound. */ |
| 847 | 847 | } | |
| 848 | |||
| 848 | return sym; | 849 | return sym; |
| 849 | } | 850 | } |
| 850 | 851 | ||
| @@ -895,7 +896,8 @@ user_variable_p_eh (Lisp_Object ignore) | |||
| 895 | static Lisp_Object | 896 | static Lisp_Object |
| 896 | lisp_indirect_variable (Lisp_Object sym) | 897 | lisp_indirect_variable (Lisp_Object sym) |
| 897 | { | 898 | { |
| 898 | XSETSYMBOL (sym, indirect_variable (XSYMBOL (sym))); | 899 | struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym)); |
| 900 | XSETSYMBOL (sym, s); | ||
| 899 | return sym; | 901 | return sym; |
| 900 | } | 902 | } |
| 901 | 903 | ||
| @@ -1720,7 +1722,7 @@ See also the function `condition-case'. */) | |||
| 1720 | if (!NILP (clause)) | 1722 | if (!NILP (clause)) |
| 1721 | break; | 1723 | break; |
| 1722 | } | 1724 | } |
| 1723 | 1725 | ||
| 1724 | if (/* Don't run the debugger for a memory-full error. | 1726 | if (/* Don't run the debugger for a memory-full error. |
| 1725 | (There is no room in memory to do that!) */ | 1727 | (There is no room in memory to do that!) */ |
| 1726 | !NILP (error_symbol) | 1728 | !NILP (error_symbol) |
| @@ -1737,13 +1739,13 @@ See also the function `condition-case'. */) | |||
| 1737 | can continue code which has signaled a quit. */ | 1739 | can continue code which has signaled a quit. */ |
| 1738 | if (debugger_called && EQ (real_error_symbol, Qquit)) | 1740 | if (debugger_called && EQ (real_error_symbol, Qquit)) |
| 1739 | return Qnil; | 1741 | return Qnil; |
| 1740 | } | 1742 | } |
| 1741 | 1743 | ||
| 1742 | if (!NILP (clause)) | 1744 | if (!NILP (clause)) |
| 1743 | { | 1745 | { |
| 1744 | Lisp_Object unwind_data | 1746 | Lisp_Object unwind_data |
| 1745 | = (NILP (error_symbol) ? data : Fcons (error_symbol, data)); | 1747 | = (NILP (error_symbol) ? data : Fcons (error_symbol, data)); |
| 1746 | 1748 | ||
| 1747 | h->chosen_clause = clause; | 1749 | h->chosen_clause = clause; |
| 1748 | unwind_to_catch (h->tag, unwind_data); | 1750 | unwind_to_catch (h->tag, unwind_data); |
| 1749 | } | 1751 | } |
| @@ -1755,7 +1757,7 @@ See also the function `condition-case'. */) | |||
| 1755 | 1757 | ||
| 1756 | if (! NILP (error_symbol)) | 1758 | if (! NILP (error_symbol)) |
| 1757 | data = Fcons (error_symbol, data); | 1759 | data = Fcons (error_symbol, data); |
| 1758 | 1760 | ||
| 1759 | string = Ferror_message_string (data); | 1761 | string = Ferror_message_string (data); |
| 1760 | fatal ("%s", SDATA (string), 0); | 1762 | fatal ("%s", SDATA (string), 0); |
| 1761 | } | 1763 | } |
| @@ -2648,8 +2650,8 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2648 | } | 2650 | } |
| 2649 | else | 2651 | else |
| 2650 | { | 2652 | { |
| 2651 | Lisp_Object globals = Qnil; | 2653 | Lisp_Object global_vals = Qnil; |
| 2652 | GCPRO3 (sym, val, globals); | 2654 | GCPRO3 (sym, val, global_vals); |
| 2653 | 2655 | ||
| 2654 | for (; | 2656 | for (; |
| 2655 | CONSP (val) && ((cond == to_completion) | 2657 | CONSP (val) && ((cond == to_completion) |
| @@ -2661,23 +2663,25 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2661 | { | 2663 | { |
| 2662 | /* t indicates this hook has a local binding; | 2664 | /* t indicates this hook has a local binding; |
| 2663 | it means to run the global binding too. */ | 2665 | it means to run the global binding too. */ |
| 2664 | globals = Fdefault_value (sym); | 2666 | global_vals = Fdefault_value (sym); |
| 2665 | if (NILP (globals)) continue; | 2667 | if (NILP (global_vals)) continue; |
| 2666 | 2668 | ||
| 2667 | if (!CONSP (globals) || EQ (XCAR (globals), Qlambda)) | 2669 | if (!CONSP (global_vals) || EQ (XCAR (global_vals), Qlambda)) |
| 2668 | { | 2670 | { |
| 2669 | args[0] = globals; | 2671 | args[0] = global_vals; |
| 2670 | ret = Ffuncall (nargs, args); | 2672 | ret = Ffuncall (nargs, args); |
| 2671 | } | 2673 | } |
| 2672 | else | 2674 | else |
| 2673 | { | 2675 | { |
| 2674 | for (; | 2676 | for (; |
| 2675 | CONSP (globals) && ((cond == to_completion) | 2677 | (CONSP (global_vals) |
| 2676 | || (cond == until_success ? NILP (ret) | 2678 | && (cond == to_completion |
| 2677 | : !NILP (ret))); | 2679 | || (cond == until_success |
| 2678 | globals = XCDR (globals)) | 2680 | ? NILP (ret) |
| 2681 | : !NILP (ret)))); | ||
| 2682 | global_vals = XCDR (global_vals)) | ||
| 2679 | { | 2683 | { |
| 2680 | args[0] = XCAR (globals); | 2684 | args[0] = XCAR (global_vals); |
| 2681 | /* In a global value, t should not occur. If it does, we | 2685 | /* In a global value, t should not occur. If it does, we |
| 2682 | must ignore it to avoid an endless loop. */ | 2686 | must ignore it to avoid an endless loop. */ |
| 2683 | if (!EQ (args[0], Qt)) | 2687 | if (!EQ (args[0], Qt)) |
| @@ -3248,7 +3252,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, | |||
| 3248 | return object; | 3252 | return object; |
| 3249 | } | 3253 | } |
| 3250 | 3254 | ||
| 3251 | void | 3255 | static void |
| 3252 | grow_specpdl (void) | 3256 | grow_specpdl (void) |
| 3253 | { | 3257 | { |
| 3254 | register int count = SPECPDL_INDEX (); | 3258 | register int count = SPECPDL_INDEX (); |
| @@ -3823,4 +3827,3 @@ alist of active lexical bindings. */); | |||
| 3823 | defsubr (&Sspecial_variable_p); | 3827 | defsubr (&Sspecial_variable_p); |
| 3824 | defsubr (&Sfunctionp); | 3828 | defsubr (&Sfunctionp); |
| 3825 | } | 3829 | } |
| 3826 | |||