diff options
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/eval.c b/src/eval.c index 8bb201c5df5..445eb283114 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -722,35 +722,36 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) | |||
| 722 | 722 | ||
| 723 | 723 | ||
| 724 | DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, | 724 | DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, |
| 725 | doc: /* Make SYMBOL a variable alias for symbol ALIASED. | 725 | doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. |
| 726 | Setting the value of SYMBOL will subsequently set the value of ALIASED, | 726 | Setting the value of NEW-ALIAS will subsequently set the value of BASE-VARIABLE, |
| 727 | and getting the value of SYMBOL will return the value ALIASED has. | 727 | and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has. |
| 728 | Third arg DOCSTRING, if non-nil, is documentation for SYMBOL. If it is | 728 | Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is |
| 729 | omitted or nil, SYMBOL gets the documentation string of ALIASED, or of the | 729 | omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE, |
| 730 | variable at the end of the chain of aliases, if ALIASED is itself an alias. | 730 | or of the variable at the end of the chain of aliases, if BASE-VARIABLE is |
| 731 | The return value is ALIASED. */) | 731 | itself an alias. |
| 732 | (symbol, aliased, docstring) | 732 | The return value is BASE-VARIABLE. */) |
| 733 | Lisp_Object symbol, aliased, docstring; | 733 | (new_alias, base_variable, docstring) |
| 734 | Lisp_Object new_alias, base_variable, docstring; | ||
| 734 | { | 735 | { |
| 735 | struct Lisp_Symbol *sym; | 736 | struct Lisp_Symbol *sym; |
| 736 | 737 | ||
| 737 | CHECK_SYMBOL (symbol); | 738 | CHECK_SYMBOL (new_alias); |
| 738 | CHECK_SYMBOL (aliased); | 739 | CHECK_SYMBOL (base_variable); |
| 739 | 740 | ||
| 740 | if (SYMBOL_CONSTANT_P (symbol)) | 741 | if (SYMBOL_CONSTANT_P (new_alias)) |
| 741 | error ("Cannot make a constant an alias"); | 742 | error ("Cannot make a constant an alias"); |
| 742 | 743 | ||
| 743 | sym = XSYMBOL (symbol); | 744 | sym = XSYMBOL (new_alias); |
| 744 | sym->indirect_variable = 1; | 745 | sym->indirect_variable = 1; |
| 745 | sym->value = aliased; | 746 | sym->value = base_variable; |
| 746 | sym->constant = SYMBOL_CONSTANT_P (aliased); | 747 | sym->constant = SYMBOL_CONSTANT_P (base_variable); |
| 747 | LOADHIST_ATTACH (symbol); | 748 | LOADHIST_ATTACH (new_alias); |
| 748 | if (!NILP (docstring)) | 749 | if (!NILP (docstring)) |
| 749 | Fput (symbol, Qvariable_documentation, docstring); | 750 | Fput (new_alias, Qvariable_documentation, docstring); |
| 750 | else | 751 | else |
| 751 | Fput (symbol, Qvariable_documentation, Qnil); | 752 | Fput (new_alias, Qvariable_documentation, Qnil); |
| 752 | 753 | ||
| 753 | return aliased; | 754 | return base_variable; |
| 754 | } | 755 | } |
| 755 | 756 | ||
| 756 | 757 | ||
| @@ -1971,7 +1972,7 @@ do_autoload (fundef, funname) | |||
| 1971 | GCPRO3 (fun, funname, fundef); | 1972 | GCPRO3 (fun, funname, fundef); |
| 1972 | 1973 | ||
| 1973 | /* Preserve the match data. */ | 1974 | /* Preserve the match data. */ |
| 1974 | record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); | 1975 | record_unwind_save_match_data (); |
| 1975 | 1976 | ||
| 1976 | /* Value saved here is to be restored into Vautoload_queue. */ | 1977 | /* Value saved here is to be restored into Vautoload_queue. */ |
| 1977 | record_unwind_protect (un_autoload, Vautoload_queue); | 1978 | record_unwind_protect (un_autoload, Vautoload_queue); |
| @@ -3130,10 +3131,10 @@ unbind_to (count, value) | |||
| 3130 | int count; | 3131 | int count; |
| 3131 | Lisp_Object value; | 3132 | Lisp_Object value; |
| 3132 | { | 3133 | { |
| 3133 | int quitf = !NILP (Vquit_flag); | 3134 | Lisp_Object quitf = Vquit_flag; |
| 3134 | struct gcpro gcpro1; | 3135 | struct gcpro gcpro1, gcpro2; |
| 3135 | 3136 | ||
| 3136 | GCPRO1 (value); | 3137 | GCPRO2 (value, quitf); |
| 3137 | Vquit_flag = Qnil; | 3138 | Vquit_flag = Qnil; |
| 3138 | 3139 | ||
| 3139 | while (specpdl_ptr != specpdl + count) | 3140 | while (specpdl_ptr != specpdl + count) |
| @@ -3182,8 +3183,8 @@ unbind_to (count, value) | |||
| 3182 | } | 3183 | } |
| 3183 | } | 3184 | } |
| 3184 | 3185 | ||
| 3185 | if (NILP (Vquit_flag) && quitf) | 3186 | if (NILP (Vquit_flag) && !NILP (quitf)) |
| 3186 | Vquit_flag = Qt; | 3187 | Vquit_flag = quitf; |
| 3187 | 3188 | ||
| 3188 | UNGCPRO; | 3189 | UNGCPRO; |
| 3189 | return value; | 3190 | return value; |