aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorXue Fuqiao2013-09-04 08:39:34 +0800
committerXue Fuqiao2013-09-04 08:39:34 +0800
commitadf2fc4a01efe77d73cd52bc9173914ed56ff531 (patch)
treea5a280a5554a7bffeaf94fccae29fa3ac1a5d066 /src/eval.c
parent63191d9f2043d2e67657e85a7b3842805dd1dad6 (diff)
parent38726039b77db432989fed106c88e9f1aa463281 (diff)
downloademacs-adf2fc4a01efe77d73cd52bc9173914ed56ff531.tar.gz
emacs-adf2fc4a01efe77d73cd52bc9173914ed56ff531.zip
Merge from mainline.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/eval.c b/src/eval.c
index 8ee259110f4..1ce14ae94a6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2149,6 +2149,8 @@ eval_sub (Lisp_Object form)
2149 if (SYMBOLP (fun) && !NILP (fun) 2149 if (SYMBOLP (fun) && !NILP (fun)
2150 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2150 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2151 fun = indirect_function (fun); 2151 fun = indirect_function (fun);
2152 else
2153 fun = Ffunction (Fcons (fun, Qnil));
2152 2154
2153 if (SUBRP (fun)) 2155 if (SUBRP (fun))
2154 { 2156 {
@@ -3151,20 +3153,17 @@ let_shadows_global_binding_p (Lisp_Object symbol)
3151 return 0; 3153 return 0;
3152} 3154}
3153 3155
3154/* `specpdl_ptr->symbol' is a field which describes which variable is 3156/* `specpdl_ptr' describes which variable is
3155 let-bound, so it can be properly undone when we unbind_to. 3157 let-bound, so it can be properly undone when we unbind_to.
3156 It can have the following two shapes: 3158 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 3159 - 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 3160 aliased (i.e. when let-binding V1 that's aliased to V2, we want
3161 to record V2 here). 3161 to record V2 here).
3162 - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for 3162 - WHERE tells us in which buffer the binding took place.
3163 variable SYMBOL which can be buffer-local. WHERE tells us 3163 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 3164 buffer-local variable) as well as for SPECPDL_LET_DEFAULT bindings,
3165 global value of the variable) and BUFFER tells us which buffer was 3165 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 3166 buffer-local. */
3167 BUFFER did not yet have a buffer-local value). */
3168 3167
3169void 3168void
3170specbind (Lisp_Object symbol, Lisp_Object value) 3169specbind (Lisp_Object symbol, Lisp_Object value)
@@ -3302,6 +3301,16 @@ clear_unwind_protect (ptrdiff_t count)
3302 previous value without invoking it. */ 3301 previous value without invoking it. */
3303 3302
3304void 3303void
3304set_unwind_protect (ptrdiff_t count, void (*func) (Lisp_Object),
3305 Lisp_Object arg)
3306{
3307 union specbinding *p = specpdl + count;
3308 p->unwind.kind = SPECPDL_UNWIND;
3309 p->unwind.func = func;
3310 p->unwind.arg = arg;
3311}
3312
3313void
3305set_unwind_protect_ptr (ptrdiff_t count, void (*func) (void *), void *arg) 3314set_unwind_protect_ptr (ptrdiff_t count, void (*func) (void *), void *arg)
3306{ 3315{
3307 union specbinding *p = specpdl + count; 3316 union specbinding *p = specpdl + count;