aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorPaul Eggert2017-11-13 10:54:20 -0800
committerPaul Eggert2017-11-13 10:54:20 -0800
commit99ceefa8ec4f9993663492cfcce6bb82a94569c1 (patch)
tree507f76715b3086f34672b7c984dc09befaa57fc6 /src/eval.c
parenta7b7b85567f766ff510a5eaaaf32dbbbec15efd0 (diff)
parent79108894dbcd642121466bb6af6c98c6a56e9233 (diff)
downloademacs-99ceefa8ec4f9993663492cfcce6bb82a94569c1.tar.gz
emacs-99ceefa8ec4f9993663492cfcce6bb82a94569c1.zip
Merge from origin/emacs-26
79108894db Port to IBM xlc 12.01 d14956099d Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED b1573a97e1 Use alignas to fix GCALIGN-related bugs 5d68dc9a2f Change vectorlike from struct to union 6aa0a26b46 Don't enable cursor-sensor-mode in mhtml-mode 2b8ef8dddf * lisp/files.el (abbreviate-file-name): Doc fix. (Bug#29267) fe85ce1e16 Unbreak interactive run of a flymake test (bug#29267) 48ad00390d Fix Bug#29225 42daf83f08 CC Mode: Fix defun-open being recognized as brace-list-ope... 7775c47298 Merge from Gnulib e470d16448 Pacify GCC when configured --with-x-toolkit=no 49450d0951 * lisp/find-dired.el (find-grep-dired): Doc fix. (Bug#29262) e286b3381f Fix more flymake-diag-region eob corner cases and add test... # Conflicts: # src/lisp.h
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/eval.c b/src/eval.c
index 063deb4ba03..ec507dd2042 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -603,7 +603,7 @@ The return value is BASE-VARIABLE. */)
603 603
604 sym = XSYMBOL (new_alias); 604 sym = XSYMBOL (new_alias);
605 605
606 switch (sym->redirect) 606 switch (sym->u.s.redirect)
607 { 607 {
608 case SYMBOL_FORWARDED: 608 case SYMBOL_FORWARDED:
609 error ("Cannot make an internal variable an alias"); 609 error ("Cannot make an internal variable an alias");
@@ -632,14 +632,14 @@ The return value is BASE-VARIABLE. */)
632 error ("Don't know how to make a let-bound variable an alias"); 632 error ("Don't know how to make a let-bound variable an alias");
633 } 633 }
634 634
635 if (sym->trapped_write == SYMBOL_TRAPPED_WRITE) 635 if (sym->u.s.trapped_write == SYMBOL_TRAPPED_WRITE)
636 notify_variable_watchers (new_alias, base_variable, Qdefvaralias, Qnil); 636 notify_variable_watchers (new_alias, base_variable, Qdefvaralias, Qnil);
637 637
638 sym->declared_special = 1; 638 sym->u.s.declared_special = true;
639 XSYMBOL (base_variable)->declared_special = 1; 639 XSYMBOL (base_variable)->u.s.declared_special = true;
640 sym->redirect = SYMBOL_VARALIAS; 640 sym->u.s.redirect = SYMBOL_VARALIAS;
641 SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable)); 641 SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable));
642 sym->trapped_write = XSYMBOL (base_variable)->trapped_write; 642 sym->u.s.trapped_write = XSYMBOL (base_variable)->u.s.trapped_write;
643 LOADHIST_ATTACH (new_alias); 643 LOADHIST_ATTACH (new_alias);
644 /* Even if docstring is nil: remove old docstring. */ 644 /* Even if docstring is nil: remove old docstring. */
645 Fput (new_alias, Qvariable_documentation, docstring); 645 Fput (new_alias, Qvariable_documentation, docstring);
@@ -745,7 +745,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
745 tem = Fdefault_boundp (sym); 745 tem = Fdefault_boundp (sym);
746 746
747 /* Do it before evaluating the initial value, for self-references. */ 747 /* Do it before evaluating the initial value, for self-references. */
748 XSYMBOL (sym)->declared_special = 1; 748 XSYMBOL (sym)->u.s.declared_special = true;
749 749
750 if (NILP (tem)) 750 if (NILP (tem))
751 Fset_default (sym, eval_sub (XCAR (tail))); 751 Fset_default (sym, eval_sub (XCAR (tail)));
@@ -769,7 +769,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
769 LOADHIST_ATTACH (sym); 769 LOADHIST_ATTACH (sym);
770 } 770 }
771 else if (!NILP (Vinternal_interpreter_environment) 771 else if (!NILP (Vinternal_interpreter_environment)
772 && !XSYMBOL (sym)->declared_special) 772 && !XSYMBOL (sym)->u.s.declared_special)
773 /* A simple (defvar foo) with lexical scoping does "nothing" except 773 /* A simple (defvar foo) with lexical scoping does "nothing" except
774 declare that var to be dynamically scoped *locally* (i.e. within 774 declare that var to be dynamically scoped *locally* (i.e. within
775 the current file or let-block). */ 775 the current file or let-block). */
@@ -818,7 +818,7 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
818 if (!NILP (Vpurify_flag)) 818 if (!NILP (Vpurify_flag))
819 tem = Fpurecopy (tem); 819 tem = Fpurecopy (tem);
820 Fset_default (sym, tem); 820 Fset_default (sym, tem);
821 XSYMBOL (sym)->declared_special = 1; 821 XSYMBOL (sym)->u.s.declared_special = true;
822 if (!NILP (docstring)) 822 if (!NILP (docstring))
823 { 823 {
824 if (!NILP (Vpurify_flag)) 824 if (!NILP (Vpurify_flag))
@@ -837,7 +837,7 @@ DEFUN ("internal-make-var-non-special", Fmake_var_non_special,
837 (Lisp_Object symbol) 837 (Lisp_Object symbol)
838{ 838{
839 CHECK_SYMBOL (symbol); 839 CHECK_SYMBOL (symbol);
840 XSYMBOL (symbol)->declared_special = 0; 840 XSYMBOL (symbol)->u.s.declared_special = false;
841 return Qnil; 841 return Qnil;
842} 842}
843 843
@@ -877,7 +877,7 @@ usage: (let* VARLIST BODY...) */)
877 } 877 }
878 878
879 if (!NILP (lexenv) && SYMBOLP (var) 879 if (!NILP (lexenv) && SYMBOLP (var)
880 && !XSYMBOL (var)->declared_special 880 && !XSYMBOL (var)->u.s.declared_special
881 && NILP (Fmemq (var, Vinternal_interpreter_environment))) 881 && NILP (Fmemq (var, Vinternal_interpreter_environment)))
882 /* Lexically bind VAR by adding it to the interpreter's binding 882 /* Lexically bind VAR by adding it to the interpreter's binding
883 alist. */ 883 alist. */
@@ -953,7 +953,7 @@ usage: (let VARLIST BODY...) */)
953 tem = temps[argnum]; 953 tem = temps[argnum];
954 954
955 if (!NILP (lexenv) && SYMBOLP (var) 955 if (!NILP (lexenv) && SYMBOLP (var)
956 && !XSYMBOL (var)->declared_special 956 && !XSYMBOL (var)->u.s.declared_special
957 && NILP (Fmemq (var, Vinternal_interpreter_environment))) 957 && NILP (Fmemq (var, Vinternal_interpreter_environment)))
958 /* Lexically bind VAR by adding it to the lexenv alist. */ 958 /* Lexically bind VAR by adding it to the lexenv alist. */
959 lexenv = Fcons (Fcons (var, tem), lexenv); 959 lexenv = Fcons (Fcons (var, tem), lexenv);
@@ -1022,7 +1022,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
1022 tem = Fassq (sym, environment); 1022 tem = Fassq (sym, environment);
1023 if (NILP (tem)) 1023 if (NILP (tem))
1024 { 1024 {
1025 def = XSYMBOL (sym)->function; 1025 def = XSYMBOL (sym)->u.s.function;
1026 if (!NILP (def)) 1026 if (!NILP (def))
1027 continue; 1027 continue;
1028 } 1028 }
@@ -1932,8 +1932,8 @@ this does nothing and returns nil. */)
1932 CHECK_STRING (file); 1932 CHECK_STRING (file);
1933 1933
1934 /* If function is defined and not as an autoload, don't override. */ 1934 /* If function is defined and not as an autoload, don't override. */
1935 if (!NILP (XSYMBOL (function)->function) 1935 if (!NILP (XSYMBOL (function)->u.s.function)
1936 && !AUTOLOADP (XSYMBOL (function)->function)) 1936 && !AUTOLOADP (XSYMBOL (function)->u.s.function))
1937 return Qnil; 1937 return Qnil;
1938 1938
1939 if (!NILP (Vpurify_flag) && EQ (docstring, make_number (0))) 1939 if (!NILP (Vpurify_flag) && EQ (docstring, make_number (0)))
@@ -2165,7 +2165,7 @@ eval_sub (Lisp_Object form)
2165 fun = original_fun; 2165 fun = original_fun;
2166 if (!SYMBOLP (fun)) 2166 if (!SYMBOLP (fun))
2167 fun = Ffunction (Fcons (fun, Qnil)); 2167 fun = Ffunction (Fcons (fun, Qnil));
2168 else if (!NILP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2168 else if (!NILP (fun) && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
2169 fun = indirect_function (fun); 2169 fun = indirect_function (fun);
2170 2170
2171 if (SUBRP (fun)) 2171 if (SUBRP (fun))
@@ -2348,7 +2348,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2348 2348
2349 /* Optimize for no indirection. */ 2349 /* Optimize for no indirection. */
2350 if (SYMBOLP (fun) && !NILP (fun) 2350 if (SYMBOLP (fun) && !NILP (fun)
2351 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2351 && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
2352 { 2352 {
2353 fun = indirect_function (fun); 2353 fun = indirect_function (fun);
2354 if (NILP (fun)) 2354 if (NILP (fun))
@@ -2760,7 +2760,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2760 /* Optimize for no indirection. */ 2760 /* Optimize for no indirection. */
2761 fun = original_fun; 2761 fun = original_fun;
2762 if (SYMBOLP (fun) && !NILP (fun) 2762 if (SYMBOLP (fun) && !NILP (fun)
2763 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2763 && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
2764 fun = indirect_function (fun); 2764 fun = indirect_function (fun);
2765 2765
2766 if (SUBRP (fun)) 2766 if (SUBRP (fun))
@@ -3076,7 +3076,7 @@ function with `&rest' args, or `unevalled' for a special form. */)
3076 function = original; 3076 function = original;
3077 if (SYMBOLP (function) && !NILP (function)) 3077 if (SYMBOLP (function) && !NILP (function))
3078 { 3078 {
3079 function = XSYMBOL (function)->function; 3079 function = XSYMBOL (function)->u.s.function;
3080 if (SYMBOLP (function)) 3080 if (SYMBOLP (function))
3081 function = indirect_function (function); 3081 function = indirect_function (function);
3082 } 3082 }
@@ -3215,7 +3215,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
3215 if ((--p)->kind > SPECPDL_LET) 3215 if ((--p)->kind > SPECPDL_LET)
3216 { 3216 {
3217 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (specpdl_symbol (p)); 3217 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (specpdl_symbol (p));
3218 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS); 3218 eassert (let_bound_symbol->u.s.redirect != SYMBOL_VARALIAS);
3219 if (symbol == let_bound_symbol 3219 if (symbol == let_bound_symbol
3220 && EQ (specpdl_where (p), buf)) 3220 && EQ (specpdl_where (p), buf))
3221 return 1; 3221 return 1;
@@ -3228,10 +3228,10 @@ static void
3228do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, 3228do_specbind (struct Lisp_Symbol *sym, union specbinding *bind,
3229 Lisp_Object value, enum Set_Internal_Bind bindflag) 3229 Lisp_Object value, enum Set_Internal_Bind bindflag)
3230{ 3230{
3231 switch (sym->redirect) 3231 switch (sym->u.s.redirect)
3232 { 3232 {
3233 case SYMBOL_PLAINVAL: 3233 case SYMBOL_PLAINVAL:
3234 if (!sym->trapped_write) 3234 if (!sym->u.s.trapped_write)
3235 SET_SYMBOL_VAL (sym, value); 3235 SET_SYMBOL_VAL (sym, value);
3236 else 3236 else
3237 set_internal (specpdl_symbol (bind), value, Qnil, bindflag); 3237 set_internal (specpdl_symbol (bind), value, Qnil, bindflag);
@@ -3275,7 +3275,7 @@ specbind (Lisp_Object symbol, Lisp_Object value)
3275 sym = XSYMBOL (symbol); 3275 sym = XSYMBOL (symbol);
3276 3276
3277 start: 3277 start:
3278 switch (sym->redirect) 3278 switch (sym->u.s.redirect)
3279 { 3279 {
3280 case SYMBOL_VARALIAS: 3280 case SYMBOL_VARALIAS:
3281 sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start; 3281 sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start;
@@ -3299,10 +3299,10 @@ specbind (Lisp_Object symbol, Lisp_Object value)
3299 specpdl_ptr->let.where = Fcurrent_buffer (); 3299 specpdl_ptr->let.where = Fcurrent_buffer ();
3300 specpdl_ptr->let.saved_value = Qnil; 3300 specpdl_ptr->let.saved_value = Qnil;
3301 3301
3302 eassert (sym->redirect != SYMBOL_LOCALIZED 3302 eassert (sym->u.s.redirect != SYMBOL_LOCALIZED
3303 || (EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ()))); 3303 || (EQ (SYMBOL_BLV (sym)->where, Fcurrent_buffer ())));
3304 3304
3305 if (sym->redirect == SYMBOL_LOCALIZED) 3305 if (sym->u.s.redirect == SYMBOL_LOCALIZED)
3306 { 3306 {
3307 if (!blv_found (SYMBOL_BLV (sym))) 3307 if (!blv_found (SYMBOL_BLV (sym)))
3308 specpdl_ptr->let.kind = SPECPDL_LET_DEFAULT; 3308 specpdl_ptr->let.kind = SPECPDL_LET_DEFAULT;
@@ -3413,9 +3413,9 @@ do_one_unbind (union specbinding *this_binding, bool unwinding,
3413 { /* If variable has a trivial value (no forwarding), and isn't 3413 { /* If variable has a trivial value (no forwarding), and isn't
3414 trapped, we can just set it. */ 3414 trapped, we can just set it. */
3415 Lisp_Object sym = specpdl_symbol (this_binding); 3415 Lisp_Object sym = specpdl_symbol (this_binding);
3416 if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL) 3416 if (SYMBOLP (sym) && XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL)
3417 { 3417 {
3418 if (XSYMBOL (sym)->trapped_write == SYMBOL_UNTRAPPED_WRITE) 3418 if (XSYMBOL (sym)->u.s.trapped_write == SYMBOL_UNTRAPPED_WRITE)
3419 SET_SYMBOL_VAL (XSYMBOL (sym), specpdl_old_value (this_binding)); 3419 SET_SYMBOL_VAL (XSYMBOL (sym), specpdl_old_value (this_binding));
3420 else 3420 else
3421 set_internal (sym, specpdl_old_value (this_binding), 3421 set_internal (sym, specpdl_old_value (this_binding),
@@ -3547,7 +3547,7 @@ context where binding is lexical by default. */)
3547 (Lisp_Object symbol) 3547 (Lisp_Object symbol)
3548{ 3548{
3549 CHECK_SYMBOL (symbol); 3549 CHECK_SYMBOL (symbol);
3550 return XSYMBOL (symbol)->declared_special ? Qt : Qnil; 3550 return XSYMBOL (symbol)->u.s.declared_special ? Qt : Qnil;
3551} 3551}
3552 3552
3553 3553
@@ -3703,7 +3703,8 @@ backtrace_eval_unrewind (int distance)
3703 just set it. No need to check for constant symbols here, 3703 just set it. No need to check for constant symbols here,
3704 since that was already done by specbind. */ 3704 since that was already done by specbind. */
3705 Lisp_Object sym = specpdl_symbol (tmp); 3705 Lisp_Object sym = specpdl_symbol (tmp);
3706 if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL) 3706 if (SYMBOLP (sym)
3707 && XSYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL)
3707 { 3708 {
3708 Lisp_Object old_value = specpdl_old_value (tmp); 3709 Lisp_Object old_value = specpdl_old_value (tmp);
3709 set_specpdl_old_value (tmp, SYMBOL_VAL (XSYMBOL (sym))); 3710 set_specpdl_old_value (tmp, SYMBOL_VAL (XSYMBOL (sym)));