diff options
| author | Joakim Verona | 2012-05-30 14:08:12 +0200 |
|---|---|---|
| committer | Joakim Verona | 2012-05-30 14:08:12 +0200 |
| commit | 70700d8c47a35b19e29607ac5f0ed322bdd78249 (patch) | |
| tree | 4fa00d3fac00025354f0b6e23dcda1b58689a094 /src/eval.c | |
| parent | 44fce8ffe7198991c41c985ff4e67ec7d407907e (diff) | |
| parent | 72cb32cf2f0938dd7dc733eed77b1ed1e497b053 (diff) | |
| download | emacs-70700d8c47a35b19e29607ac5f0ed322bdd78249.tar.gz emacs-70700d8c47a35b19e29607ac5f0ed322bdd78249.zip | |
upstream
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 222 |
1 files changed, 38 insertions, 184 deletions
diff --git a/src/eval.c b/src/eval.c index 3d0e82c2d9f..1da841a4073 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -65,7 +65,7 @@ struct handler *handlerlist; | |||
| 65 | int gcpro_level; | 65 | int gcpro_level; |
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun; | 68 | Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp; |
| 69 | Lisp_Object Qinhibit_quit; | 69 | Lisp_Object Qinhibit_quit; |
| 70 | Lisp_Object Qand_rest; | 70 | Lisp_Object Qand_rest; |
| 71 | static Lisp_Object Qand_optional; | 71 | static Lisp_Object Qand_optional; |
| @@ -90,7 +90,7 @@ Lisp_Object Vautoload_queue; | |||
| 90 | 90 | ||
| 91 | /* Current number of specbindings allocated in specpdl. */ | 91 | /* Current number of specbindings allocated in specpdl. */ |
| 92 | 92 | ||
| 93 | EMACS_INT specpdl_size; | 93 | ptrdiff_t specpdl_size; |
| 94 | 94 | ||
| 95 | /* Pointer to beginning of specpdl. */ | 95 | /* Pointer to beginning of specpdl. */ |
| 96 | 96 | ||
| @@ -111,7 +111,7 @@ static EMACS_INT lisp_eval_depth; | |||
| 111 | signal the error instead of entering an infinite loop of debugger | 111 | signal the error instead of entering an infinite loop of debugger |
| 112 | invocations. */ | 112 | invocations. */ |
| 113 | 113 | ||
| 114 | static int when_entered_debugger; | 114 | static EMACS_INT when_entered_debugger; |
| 115 | 115 | ||
| 116 | /* The function from which the last `signal' was called. Set in | 116 | /* The function from which the last `signal' was called. Set in |
| 117 | Fsignal. */ | 117 | Fsignal. */ |
| @@ -183,7 +183,7 @@ static Lisp_Object | |||
| 183 | call_debugger (Lisp_Object arg) | 183 | call_debugger (Lisp_Object arg) |
| 184 | { | 184 | { |
| 185 | int debug_while_redisplaying; | 185 | int debug_while_redisplaying; |
| 186 | int count = SPECPDL_INDEX (); | 186 | ptrdiff_t count = SPECPDL_INDEX (); |
| 187 | Lisp_Object val; | 187 | Lisp_Object val; |
| 188 | EMACS_INT old_max = max_specpdl_size; | 188 | EMACS_INT old_max = max_specpdl_size; |
| 189 | 189 | ||
| @@ -379,23 +379,14 @@ usage: (prog1 FIRST BODY...) */) | |||
| 379 | Lisp_Object val; | 379 | Lisp_Object val; |
| 380 | register Lisp_Object args_left; | 380 | register Lisp_Object args_left; |
| 381 | struct gcpro gcpro1, gcpro2; | 381 | struct gcpro gcpro1, gcpro2; |
| 382 | register int argnum = 0; | ||
| 383 | |||
| 384 | if (NILP (args)) | ||
| 385 | return Qnil; | ||
| 386 | 382 | ||
| 387 | args_left = args; | 383 | args_left = args; |
| 388 | val = Qnil; | 384 | val = Qnil; |
| 389 | GCPRO2 (args, val); | 385 | GCPRO2 (args, val); |
| 390 | 386 | ||
| 391 | do | 387 | val = eval_sub (XCAR (args_left)); |
| 392 | { | 388 | while (CONSP (args_left = XCDR (args_left))) |
| 393 | Lisp_Object tem = eval_sub (XCAR (args_left)); | 389 | eval_sub (XCAR (args_left)); |
| 394 | if (!(argnum++)) | ||
| 395 | val = tem; | ||
| 396 | args_left = XCDR (args_left); | ||
| 397 | } | ||
| 398 | while (CONSP (args_left)); | ||
| 399 | 390 | ||
| 400 | UNGCPRO; | 391 | UNGCPRO; |
| 401 | return val; | 392 | return val; |
| @@ -408,31 +399,12 @@ remaining args, whose values are discarded. | |||
| 408 | usage: (prog2 FORM1 FORM2 BODY...) */) | 399 | usage: (prog2 FORM1 FORM2 BODY...) */) |
| 409 | (Lisp_Object args) | 400 | (Lisp_Object args) |
| 410 | { | 401 | { |
| 411 | Lisp_Object val; | 402 | struct gcpro gcpro1; |
| 412 | register Lisp_Object args_left; | ||
| 413 | struct gcpro gcpro1, gcpro2; | ||
| 414 | register int argnum = -1; | ||
| 415 | |||
| 416 | val = Qnil; | ||
| 417 | |||
| 418 | if (NILP (args)) | ||
| 419 | return Qnil; | ||
| 420 | |||
| 421 | args_left = args; | ||
| 422 | val = Qnil; | ||
| 423 | GCPRO2 (args, val); | ||
| 424 | |||
| 425 | do | ||
| 426 | { | ||
| 427 | Lisp_Object tem = eval_sub (XCAR (args_left)); | ||
| 428 | if (!(argnum++)) | ||
| 429 | val = tem; | ||
| 430 | args_left = XCDR (args_left); | ||
| 431 | } | ||
| 432 | while (CONSP (args_left)); | ||
| 433 | 403 | ||
| 404 | GCPRO1 (args); | ||
| 405 | eval_sub (XCAR (args)); | ||
| 434 | UNGCPRO; | 406 | UNGCPRO; |
| 435 | return val; | 407 | return Fprog1 (XCDR (args)); |
| 436 | } | 408 | } |
| 437 | 409 | ||
| 438 | DEFUN ("setq", Fsetq, Ssetq, 0, UNEVALLED, 0, | 410 | DEFUN ("setq", Fsetq, Ssetq, 0, UNEVALLED, 0, |
| @@ -621,109 +593,6 @@ interactive_p (int exclude_subrs_p) | |||
| 621 | } | 593 | } |
| 622 | 594 | ||
| 623 | 595 | ||
| 624 | DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0, | ||
| 625 | doc: /* Define NAME as a function. | ||
| 626 | The definition is (lambda ARGLIST [DOCSTRING] BODY...). | ||
| 627 | See also the function `interactive'. | ||
| 628 | usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */) | ||
| 629 | (Lisp_Object args) | ||
| 630 | { | ||
| 631 | register Lisp_Object fn_name; | ||
| 632 | register Lisp_Object defn; | ||
| 633 | |||
| 634 | fn_name = Fcar (args); | ||
| 635 | CHECK_SYMBOL (fn_name); | ||
| 636 | defn = Fcons (Qlambda, Fcdr (args)); | ||
| 637 | if (!NILP (Vinternal_interpreter_environment)) /* Mere optimization! */ | ||
| 638 | defn = Ffunction (Fcons (defn, Qnil)); | ||
| 639 | if (!NILP (Vpurify_flag)) | ||
| 640 | defn = Fpurecopy (defn); | ||
| 641 | if (CONSP (XSYMBOL (fn_name)->function) | ||
| 642 | && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload)) | ||
| 643 | LOADHIST_ATTACH (Fcons (Qt, fn_name)); | ||
| 644 | Ffset (fn_name, defn); | ||
| 645 | LOADHIST_ATTACH (Fcons (Qdefun, fn_name)); | ||
| 646 | return fn_name; | ||
| 647 | } | ||
| 648 | |||
| 649 | DEFUN ("defmacro", Fdefmacro, Sdefmacro, 2, UNEVALLED, 0, | ||
| 650 | doc: /* Define NAME as a macro. | ||
| 651 | The actual definition looks like | ||
| 652 | (macro lambda ARGLIST [DOCSTRING] [DECL] BODY...). | ||
| 653 | When the macro is called, as in (NAME ARGS...), | ||
| 654 | the function (lambda ARGLIST BODY...) is applied to | ||
| 655 | the list ARGS... as it appears in the expression, | ||
| 656 | and the result should be a form to be evaluated instead of the original. | ||
| 657 | |||
| 658 | DECL is a declaration, optional, which can specify how to indent | ||
| 659 | calls to this macro, how Edebug should handle it, and which argument | ||
| 660 | should be treated as documentation. It looks like this: | ||
| 661 | (declare SPECS...) | ||
| 662 | The elements can look like this: | ||
| 663 | (indent INDENT) | ||
| 664 | Set NAME's `lisp-indent-function' property to INDENT. | ||
| 665 | |||
| 666 | (debug DEBUG) | ||
| 667 | Set NAME's `edebug-form-spec' property to DEBUG. (This is | ||
| 668 | equivalent to writing a `def-edebug-spec' for the macro.) | ||
| 669 | |||
| 670 | (doc-string ELT) | ||
| 671 | Set NAME's `doc-string-elt' property to ELT. | ||
| 672 | |||
| 673 | usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) | ||
| 674 | (Lisp_Object args) | ||
| 675 | { | ||
| 676 | register Lisp_Object fn_name; | ||
| 677 | register Lisp_Object defn; | ||
| 678 | Lisp_Object lambda_list, doc, tail; | ||
| 679 | |||
| 680 | fn_name = Fcar (args); | ||
| 681 | CHECK_SYMBOL (fn_name); | ||
| 682 | lambda_list = Fcar (Fcdr (args)); | ||
| 683 | tail = Fcdr (Fcdr (args)); | ||
| 684 | |||
| 685 | doc = Qnil; | ||
| 686 | if (STRINGP (Fcar (tail))) | ||
| 687 | { | ||
| 688 | doc = XCAR (tail); | ||
| 689 | tail = XCDR (tail); | ||
| 690 | } | ||
| 691 | |||
| 692 | if (CONSP (Fcar (tail)) | ||
| 693 | && EQ (Fcar (Fcar (tail)), Qdeclare)) | ||
| 694 | { | ||
| 695 | if (!NILP (Vmacro_declaration_function)) | ||
| 696 | { | ||
| 697 | struct gcpro gcpro1; | ||
| 698 | GCPRO1 (args); | ||
| 699 | call2 (Vmacro_declaration_function, fn_name, Fcar (tail)); | ||
| 700 | UNGCPRO; | ||
| 701 | } | ||
| 702 | |||
| 703 | tail = Fcdr (tail); | ||
| 704 | } | ||
| 705 | |||
| 706 | if (NILP (doc)) | ||
| 707 | tail = Fcons (lambda_list, tail); | ||
| 708 | else | ||
| 709 | tail = Fcons (lambda_list, Fcons (doc, tail)); | ||
| 710 | |||
| 711 | defn = Fcons (Qlambda, tail); | ||
| 712 | if (!NILP (Vinternal_interpreter_environment)) /* Mere optimization! */ | ||
| 713 | defn = Ffunction (Fcons (defn, Qnil)); | ||
| 714 | defn = Fcons (Qmacro, defn); | ||
| 715 | |||
| 716 | if (!NILP (Vpurify_flag)) | ||
| 717 | defn = Fpurecopy (defn); | ||
| 718 | if (CONSP (XSYMBOL (fn_name)->function) | ||
| 719 | && EQ (XCAR (XSYMBOL (fn_name)->function), Qautoload)) | ||
| 720 | LOADHIST_ATTACH (Fcons (Qt, fn_name)); | ||
| 721 | Ffset (fn_name, defn); | ||
| 722 | LOADHIST_ATTACH (Fcons (Qdefun, fn_name)); | ||
| 723 | return fn_name; | ||
| 724 | } | ||
| 725 | |||
| 726 | |||
| 727 | DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, | 596 | DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, |
| 728 | doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. | 597 | doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. |
| 729 | Aliased variables always have the same value; setting one sets the other. | 598 | Aliased variables always have the same value; setting one sets the other. |
| @@ -764,8 +633,8 @@ The return value is BASE-VARIABLE. */) | |||
| 764 | { | 633 | { |
| 765 | struct specbinding *p; | 634 | struct specbinding *p; |
| 766 | 635 | ||
| 767 | for (p = specpdl_ptr - 1; p >= specpdl; p--) | 636 | for (p = specpdl_ptr; p > specpdl; ) |
| 768 | if (p->func == NULL | 637 | if ((--p)->func == NULL |
| 769 | && (EQ (new_alias, | 638 | && (EQ (new_alias, |
| 770 | CONSP (p->symbol) ? XCAR (p->symbol) : p->symbol))) | 639 | CONSP (p->symbol) ? XCAR (p->symbol) : p->symbol))) |
| 771 | error ("Don't know how to make a let-bound variable an alias"); | 640 | error ("Don't know how to make a let-bound variable an alias"); |
| @@ -842,9 +711,9 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 842 | { /* Check if there is really a global binding rather than just a let | 711 | { /* Check if there is really a global binding rather than just a let |
| 843 | binding that shadows the global unboundness of the var. */ | 712 | binding that shadows the global unboundness of the var. */ |
| 844 | volatile struct specbinding *pdl = specpdl_ptr; | 713 | volatile struct specbinding *pdl = specpdl_ptr; |
| 845 | while (--pdl >= specpdl) | 714 | while (pdl > specpdl) |
| 846 | { | 715 | { |
| 847 | if (EQ (pdl->symbol, sym) && !pdl->func | 716 | if (EQ ((--pdl)->symbol, sym) && !pdl->func |
| 848 | && EQ (pdl->old_value, Qunbound)) | 717 | && EQ (pdl->old_value, Qunbound)) |
| 849 | { | 718 | { |
| 850 | message_with_string ("Warning: defvar ignored because %s is let-bound", | 719 | message_with_string ("Warning: defvar ignored because %s is let-bound", |
| @@ -932,7 +801,7 @@ usage: (let* VARLIST BODY...) */) | |||
| 932 | (Lisp_Object args) | 801 | (Lisp_Object args) |
| 933 | { | 802 | { |
| 934 | Lisp_Object varlist, var, val, elt, lexenv; | 803 | Lisp_Object varlist, var, val, elt, lexenv; |
| 935 | int count = SPECPDL_INDEX (); | 804 | ptrdiff_t count = SPECPDL_INDEX (); |
| 936 | struct gcpro gcpro1, gcpro2, gcpro3; | 805 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 937 | 806 | ||
| 938 | GCPRO3 (args, elt, varlist); | 807 | GCPRO3 (args, elt, varlist); |
| @@ -995,7 +864,7 @@ usage: (let VARLIST BODY...) */) | |||
| 995 | { | 864 | { |
| 996 | Lisp_Object *temps, tem, lexenv; | 865 | Lisp_Object *temps, tem, lexenv; |
| 997 | register Lisp_Object elt, varlist; | 866 | register Lisp_Object elt, varlist; |
| 998 | int count = SPECPDL_INDEX (); | 867 | ptrdiff_t count = SPECPDL_INDEX (); |
| 999 | ptrdiff_t argnum; | 868 | ptrdiff_t argnum; |
| 1000 | struct gcpro gcpro1, gcpro2; | 869 | struct gcpro gcpro1, gcpro2; |
| 1001 | USE_SAFE_ALLOCA; | 870 | USE_SAFE_ALLOCA; |
| @@ -1298,7 +1167,7 @@ usage: (unwind-protect BODYFORM UNWINDFORMS...) */) | |||
| 1298 | (Lisp_Object args) | 1167 | (Lisp_Object args) |
| 1299 | { | 1168 | { |
| 1300 | Lisp_Object val; | 1169 | Lisp_Object val; |
| 1301 | int count = SPECPDL_INDEX (); | 1170 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1302 | 1171 | ||
| 1303 | record_unwind_protect (Fprogn, Fcdr (args)); | 1172 | record_unwind_protect (Fprogn, Fcdr (args)); |
| 1304 | val = eval_sub (Fcar (args)); | 1173 | val = eval_sub (Fcar (args)); |
| @@ -2042,12 +1911,11 @@ this does nothing and returns nil. */) | |||
| 2042 | /* Only add entries after dumping, because the ones before are | 1911 | /* Only add entries after dumping, because the ones before are |
| 2043 | not useful and else we get loads of them from the loaddefs.el. */ | 1912 | not useful and else we get loads of them from the loaddefs.el. */ |
| 2044 | LOADHIST_ATTACH (Fcons (Qautoload, function)); | 1913 | LOADHIST_ATTACH (Fcons (Qautoload, function)); |
| 2045 | else | 1914 | else if (EQ (docstring, make_number (0))) |
| 2046 | /* We don't want the docstring in purespace (instead, | 1915 | /* `read1' in lread.c has found the docstring starting with "\ |
| 2047 | Snarf-documentation should (hopefully) overwrite it). | 1916 | and assumed the docstring will be provided by Snarf-documentation, so it |
| 2048 | We used to use 0 here, but that leads to accidental sharing in | 1917 | passed us 0 instead. But that leads to accidental sharing in purecopy's |
| 2049 | purecopy's hash-consing, so we use a (hopefully) unique integer | 1918 | hash-consing, so we use a (hopefully) unique integer instead. */ |
| 2050 | instead. */ | ||
| 2051 | docstring = make_number (XUNTAG (function, Lisp_Symbol)); | 1919 | docstring = make_number (XUNTAG (function, Lisp_Symbol)); |
| 2052 | return Ffset (function, | 1920 | return Ffset (function, |
| 2053 | Fpurecopy (list5 (Qautoload, file, docstring, | 1921 | Fpurecopy (list5 (Qautoload, file, docstring, |
| @@ -2084,7 +1952,7 @@ un_autoload (Lisp_Object oldqueue) | |||
| 2084 | void | 1952 | void |
| 2085 | do_autoload (Lisp_Object fundef, Lisp_Object funname) | 1953 | do_autoload (Lisp_Object fundef, Lisp_Object funname) |
| 2086 | { | 1954 | { |
| 2087 | int count = SPECPDL_INDEX (); | 1955 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2088 | Lisp_Object fun; | 1956 | Lisp_Object fun; |
| 2089 | struct gcpro gcpro1, gcpro2, gcpro3; | 1957 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 2090 | 1958 | ||
| @@ -2131,7 +1999,7 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, | |||
| 2131 | If LEXICAL is t, evaluate using lexical scoping. */) | 1999 | If LEXICAL is t, evaluate using lexical scoping. */) |
| 2132 | (Lisp_Object form, Lisp_Object lexical) | 2000 | (Lisp_Object form, Lisp_Object lexical) |
| 2133 | { | 2001 | { |
| 2134 | int count = SPECPDL_INDEX (); | 2002 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2135 | specbind (Qinternal_interpreter_environment, | 2003 | specbind (Qinternal_interpreter_environment, |
| 2136 | NILP (lexical) ? Qnil : Fcons (Qt, Qnil)); | 2004 | NILP (lexical) ? Qnil : Fcons (Qt, Qnil)); |
| 2137 | return unbind_to (count, eval_sub (form)); | 2005 | return unbind_to (count, eval_sub (form)); |
| @@ -2365,7 +2233,8 @@ Thus, (apply '+ 1 2 '(3 4)) returns 10. | |||
| 2365 | usage: (apply FUNCTION &rest ARGUMENTS) */) | 2233 | usage: (apply FUNCTION &rest ARGUMENTS) */) |
| 2366 | (ptrdiff_t nargs, Lisp_Object *args) | 2234 | (ptrdiff_t nargs, Lisp_Object *args) |
| 2367 | { | 2235 | { |
| 2368 | ptrdiff_t i, numargs; | 2236 | ptrdiff_t i; |
| 2237 | EMACS_INT numargs; | ||
| 2369 | register Lisp_Object spread_arg; | 2238 | register Lisp_Object spread_arg; |
| 2370 | register Lisp_Object *funcall_args; | 2239 | register Lisp_Object *funcall_args; |
| 2371 | Lisp_Object fun, retval; | 2240 | Lisp_Object fun, retval; |
| @@ -3015,7 +2884,8 @@ static Lisp_Object | |||
| 3015 | apply_lambda (Lisp_Object fun, Lisp_Object args) | 2884 | apply_lambda (Lisp_Object fun, Lisp_Object args) |
| 3016 | { | 2885 | { |
| 3017 | Lisp_Object args_left; | 2886 | Lisp_Object args_left; |
| 3018 | ptrdiff_t i, numargs; | 2887 | ptrdiff_t i; |
| 2888 | EMACS_INT numargs; | ||
| 3019 | register Lisp_Object *arg_vector; | 2889 | register Lisp_Object *arg_vector; |
| 3020 | struct gcpro gcpro1, gcpro2, gcpro3; | 2890 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 3021 | register Lisp_Object tem; | 2891 | register Lisp_Object tem; |
| @@ -3060,7 +2930,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, | |||
| 3060 | register Lisp_Object *arg_vector) | 2930 | register Lisp_Object *arg_vector) |
| 3061 | { | 2931 | { |
| 3062 | Lisp_Object val, syms_left, next, lexenv; | 2932 | Lisp_Object val, syms_left, next, lexenv; |
| 3063 | int count = SPECPDL_INDEX (); | 2933 | ptrdiff_t count = SPECPDL_INDEX (); |
| 3064 | ptrdiff_t i; | 2934 | ptrdiff_t i; |
| 3065 | int optional, rest; | 2935 | int optional, rest; |
| 3066 | 2936 | ||
| @@ -3199,12 +3069,8 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, | |||
| 3199 | static void | 3069 | static void |
| 3200 | grow_specpdl (void) | 3070 | grow_specpdl (void) |
| 3201 | { | 3071 | { |
| 3202 | register int count = SPECPDL_INDEX (); | 3072 | register ptrdiff_t count = SPECPDL_INDEX (); |
| 3203 | int max_size = | 3073 | ptrdiff_t max_size = min (max_specpdl_size, PTRDIFF_MAX); |
| 3204 | min (max_specpdl_size, | ||
| 3205 | min (max (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct specbinding), | ||
| 3206 | INT_MAX)); | ||
| 3207 | int size; | ||
| 3208 | if (max_size <= specpdl_size) | 3074 | if (max_size <= specpdl_size) |
| 3209 | { | 3075 | { |
| 3210 | if (max_specpdl_size < 400) | 3076 | if (max_specpdl_size < 400) |
| @@ -3212,9 +3078,7 @@ grow_specpdl (void) | |||
| 3212 | if (max_size <= specpdl_size) | 3078 | if (max_size <= specpdl_size) |
| 3213 | signal_error ("Variable binding depth exceeds max-specpdl-size", Qnil); | 3079 | signal_error ("Variable binding depth exceeds max-specpdl-size", Qnil); |
| 3214 | } | 3080 | } |
| 3215 | size = specpdl_size < max_size / 2 ? 2 * specpdl_size : max_size; | 3081 | specpdl = xpalloc (specpdl, &specpdl_size, 1, max_size, sizeof *specpdl); |
| 3216 | specpdl = xnrealloc (specpdl, size, sizeof *specpdl); | ||
| 3217 | specpdl_size = size; | ||
| 3218 | specpdl_ptr = specpdl + count; | 3082 | specpdl_ptr = specpdl + count; |
| 3219 | } | 3083 | } |
| 3220 | 3084 | ||
| @@ -3344,7 +3208,7 @@ record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) | |||
| 3344 | } | 3208 | } |
| 3345 | 3209 | ||
| 3346 | Lisp_Object | 3210 | Lisp_Object |
| 3347 | unbind_to (int count, Lisp_Object value) | 3211 | unbind_to (ptrdiff_t count, Lisp_Object value) |
| 3348 | { | 3212 | { |
| 3349 | Lisp_Object quitf = Vquit_flag; | 3213 | Lisp_Object quitf = Vquit_flag; |
| 3350 | struct gcpro gcpro1, gcpro2; | 3214 | struct gcpro gcpro1, gcpro2; |
| @@ -3424,7 +3288,7 @@ The debugger is entered when that frame exits, if the flag is non-nil. */) | |||
| 3424 | (Lisp_Object level, Lisp_Object flag) | 3288 | (Lisp_Object level, Lisp_Object flag) |
| 3425 | { | 3289 | { |
| 3426 | register struct backtrace *backlist = backtrace_list; | 3290 | register struct backtrace *backlist = backtrace_list; |
| 3427 | register int i; | 3291 | register EMACS_INT i; |
| 3428 | 3292 | ||
| 3429 | CHECK_NUMBER (level); | 3293 | CHECK_NUMBER (level); |
| 3430 | 3294 | ||
| @@ -3608,7 +3472,6 @@ before making `inhibit-quit' nil. */); | |||
| 3608 | 3472 | ||
| 3609 | DEFSYM (Qinteractive, "interactive"); | 3473 | DEFSYM (Qinteractive, "interactive"); |
| 3610 | DEFSYM (Qcommandp, "commandp"); | 3474 | DEFSYM (Qcommandp, "commandp"); |
| 3611 | DEFSYM (Qdefun, "defun"); | ||
| 3612 | DEFSYM (Qand_rest, "&rest"); | 3475 | DEFSYM (Qand_rest, "&rest"); |
| 3613 | DEFSYM (Qand_optional, "&optional"); | 3476 | DEFSYM (Qand_optional, "&optional"); |
| 3614 | DEFSYM (Qclosure, "closure"); | 3477 | DEFSYM (Qclosure, "closure"); |
| @@ -3670,23 +3533,16 @@ Note that `debug-on-error', `debug-on-quit' and friends | |||
| 3670 | still determine whether to handle the particular condition. */); | 3533 | still determine whether to handle the particular condition. */); |
| 3671 | Vdebug_on_signal = Qnil; | 3534 | Vdebug_on_signal = Qnil; |
| 3672 | 3535 | ||
| 3673 | DEFVAR_LISP ("macro-declaration-function", Vmacro_declaration_function, | ||
| 3674 | doc: /* Function to process declarations in a macro definition. | ||
| 3675 | The function will be called with two args MACRO and DECL. | ||
| 3676 | MACRO is the name of the macro being defined. | ||
| 3677 | DECL is a list `(declare ...)' containing the declarations. | ||
| 3678 | The value the function returns is not used. */); | ||
| 3679 | Vmacro_declaration_function = Qnil; | ||
| 3680 | |||
| 3681 | /* When lexical binding is being used, | 3536 | /* When lexical binding is being used, |
| 3682 | vinternal_interpreter_environment is non-nil, and contains an alist | 3537 | Vinternal_interpreter_environment is non-nil, and contains an alist |
| 3683 | of lexically-bound variable, or (t), indicating an empty | 3538 | of lexically-bound variable, or (t), indicating an empty |
| 3684 | environment. The lisp name of this variable would be | 3539 | environment. The lisp name of this variable would be |
| 3685 | `internal-interpreter-environment' if it weren't hidden. | 3540 | `internal-interpreter-environment' if it weren't hidden. |
| 3686 | Every element of this list can be either a cons (VAR . VAL) | 3541 | Every element of this list can be either a cons (VAR . VAL) |
| 3687 | specifying a lexical binding, or a single symbol VAR indicating | 3542 | specifying a lexical binding, or a single symbol VAR indicating |
| 3688 | that this variable should use dynamic scoping. */ | 3543 | that this variable should use dynamic scoping. */ |
| 3689 | DEFSYM (Qinternal_interpreter_environment, "internal-interpreter-environment"); | 3544 | DEFSYM (Qinternal_interpreter_environment, |
| 3545 | "internal-interpreter-environment"); | ||
| 3690 | DEFVAR_LISP ("internal-interpreter-environment", | 3546 | DEFVAR_LISP ("internal-interpreter-environment", |
| 3691 | Vinternal_interpreter_environment, | 3547 | Vinternal_interpreter_environment, |
| 3692 | doc: /* If non-nil, the current lexical environment of the lisp interpreter. | 3548 | doc: /* If non-nil, the current lexical environment of the lisp interpreter. |
| @@ -3717,8 +3573,6 @@ alist of active lexical bindings. */); | |||
| 3717 | defsubr (&Ssetq); | 3573 | defsubr (&Ssetq); |
| 3718 | defsubr (&Squote); | 3574 | defsubr (&Squote); |
| 3719 | defsubr (&Sfunction); | 3575 | defsubr (&Sfunction); |
| 3720 | defsubr (&Sdefun); | ||
| 3721 | defsubr (&Sdefmacro); | ||
| 3722 | defsubr (&Sdefvar); | 3576 | defsubr (&Sdefvar); |
| 3723 | defsubr (&Sdefvaralias); | 3577 | defsubr (&Sdefvaralias); |
| 3724 | defsubr (&Sdefconst); | 3578 | defsubr (&Sdefconst); |