From 3ec7babc5c774d9a24dbe68951091eb2bab08e60 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 28 Aug 2013 14:27:26 -0400 Subject: [PATCH] * src/eval.c (Ffuncall): Fix handling of ((lambda ..) ..) in lexically scoped code. Fixes: debbugs:11258 --- src/ChangeLog | 9 +++++++-- src/eval.c | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7cae8e05f25..9e62a8e08a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-08-28 Stefan Monnier + + * eval.c (Ffuncall): Fix handling of ((lambda ..) ..) in lexically + scoped code (bug#11258). + 2013-08-28 Davor Cubranic (tiny change) * nsterm.m (last_window): New variable. @@ -12,8 +17,8 @@ (SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MAKE_CHAR, BYTE8_TO_CHAR): Remove unused macro definitions. (CHARSET_RANGE_TABLE_BITS, EXTEND_RANGE_TABLE) - (SET_RANGE_TABLE_WORK_AREA_BIT, SET_RANGE_TABLE_WORK_AREA): Only - define if emacs. + (SET_RANGE_TABLE_WORK_AREA_BIT, SET_RANGE_TABLE_WORK_AREA): + Only define if emacs. 2013-08-28 Dmitry Antipov diff --git a/src/eval.c b/src/eval.c index 566be0c2a83..1ce14ae94a6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2149,6 +2149,8 @@ eval_sub (Lisp_Object form) if (SYMBOLP (fun) && !NILP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) fun = indirect_function (fun); + else + fun = Ffunction (Fcons (fun, Qnil)); if (SUBRP (fun)) { @@ -3151,20 +3153,17 @@ let_shadows_global_binding_p (Lisp_Object symbol) return 0; } -/* `specpdl_ptr->symbol' is a field which describes which variable is +/* `specpdl_ptr' describes which variable is let-bound, so it can be properly undone when we unbind_to. - It can have the following two shapes: - - SYMBOL : if it's a plain symbol, it means that we have let-bound - a symbol that is not buffer-local (at least at the time - the let binding started). Note also that it should not be + It can be either a plain SPECPDL_LET or a SPECPDL_LET_LOCAL/DEFAULT. + - SYMBOL is the variable being bound. Note that it should not be aliased (i.e. when let-binding V1 that's aliased to V2, we want to record V2 here). - - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for - variable SYMBOL which can be buffer-local. WHERE tells us - which buffer is affected (or nil if the let-binding affects the - global value of the variable) and BUFFER tells us which buffer was - current (i.e. if WHERE is non-nil, then BUFFER==WHERE, otherwise - BUFFER did not yet have a buffer-local value). */ + - WHERE tells us in which buffer the binding took place. + This is used for SPECPDL_LET_LOCAL bindings (i.e. bindings to a + buffer-local variable) as well as for SPECPDL_LET_DEFAULT bindings, + i.e. bindings to the default value of a variable which can be + buffer-local. */ void specbind (Lisp_Object symbol, Lisp_Object value) -- 2.39.2