aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorJoakim Verona2013-09-10 23:52:26 +0200
committerJoakim Verona2013-09-10 23:52:26 +0200
commit63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c (patch)
treee5078c5545c777e21944a9ee4199a6f2c6d25ca9 /src/eval.c
parent92aeabcc8a007f521a664e3aee092eb80ad0f49a (diff)
downloademacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.tar.gz
emacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.zip
merge upstream
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c
index 566be0c2a83..6e964f6604b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2033,7 +2033,9 @@ it is defines a macro. */)
2033 2033
2034DEFUN ("eval", Feval, Seval, 1, 2, 0, 2034DEFUN ("eval", Feval, Seval, 1, 2, 0,
2035 doc: /* Evaluate FORM and return its value. 2035 doc: /* Evaluate FORM and return its value.
2036If LEXICAL is t, evaluate using lexical scoping. */) 2036If LEXICAL is t, evaluate using lexical scoping.
2037LEXICAL can also be an actual lexical environment, in the form of an
2038alist mapping symbols to their value. */)
2037 (Lisp_Object form, Lisp_Object lexical) 2039 (Lisp_Object form, Lisp_Object lexical)
2038{ 2040{
2039 ptrdiff_t count = SPECPDL_INDEX (); 2041 ptrdiff_t count = SPECPDL_INDEX ();
@@ -2146,8 +2148,9 @@ eval_sub (Lisp_Object form)
2146 2148
2147 /* Optimize for no indirection. */ 2149 /* Optimize for no indirection. */
2148 fun = original_fun; 2150 fun = original_fun;
2149 if (SYMBOLP (fun) && !NILP (fun) 2151 if (!SYMBOLP (fun))
2150 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2152 fun = Ffunction (Fcons (fun, Qnil));
2153 else if (!NILP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2151 fun = indirect_function (fun); 2154 fun = indirect_function (fun);
2152 2155
2153 if (SUBRP (fun)) 2156 if (SUBRP (fun))
@@ -3151,20 +3154,17 @@ let_shadows_global_binding_p (Lisp_Object symbol)
3151 return 0; 3154 return 0;
3152} 3155}
3153 3156
3154/* `specpdl_ptr->symbol' is a field which describes which variable is 3157/* `specpdl_ptr' describes which variable is
3155 let-bound, so it can be properly undone when we unbind_to. 3158 let-bound, so it can be properly undone when we unbind_to.
3156 It can have the following two shapes: 3159 It can be either a plain SPECPDL_LET or a SPECPDL_LET_LOCAL/DEFAULT.
3157 - SYMBOL : if it's a plain symbol, it means that we have let-bound 3160 - SYMBOL is the variable being bound. Note that it should not be
3158 a symbol that is not buffer-local (at least at the time
3159 the let binding started). Note also that it should not be
3160 aliased (i.e. when let-binding V1 that's aliased to V2, we want 3161 aliased (i.e. when let-binding V1 that's aliased to V2, we want
3161 to record V2 here). 3162 to record V2 here).
3162 - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for 3163 - WHERE tells us in which buffer the binding took place.
3163 variable SYMBOL which can be buffer-local. WHERE tells us 3164 This is used for SPECPDL_LET_LOCAL bindings (i.e. bindings to a
3164 which buffer is affected (or nil if the let-binding affects the 3165 buffer-local variable) as well as for SPECPDL_LET_DEFAULT bindings,
3165 global value of the variable) and BUFFER tells us which buffer was 3166 i.e. bindings to the default value of a variable which can be
3166 current (i.e. if WHERE is non-nil, then BUFFER==WHERE, otherwise 3167 buffer-local. */
3167 BUFFER did not yet have a buffer-local value). */
3168 3168
3169void 3169void
3170specbind (Lisp_Object symbol, Lisp_Object value) 3170specbind (Lisp_Object symbol, Lisp_Object value)