Obey lexical-binding in interactive evaluation commands.
[bpt/emacs.git] / src / ChangeLog
1 2010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * eval.c (Feval): Add `lexical' argument. Adjust callers.
4 (Ffuncall, eval_sub): Avoid goto.
5
6 2010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 Try and be more careful about propagation of lexical environment.
9 * eval.c (apply_lambda, funcall_lambda): Remove lexenv arg.
10 (Feval): Always eval in the empty environment.
11 (eval_sub): New function. Use it for all calls to Feval that should
12 evaluate in the lexical environment of the caller.
13 Pass `closure's as is to apply_lambda.
14 (Ffuncall): Pass `closure's as is to funcall_lambda.
15 (funcall_lambda): Extract lexenv for `closure's, when applicable.
16 Also use lexical scoping for the &rest argument, if applicable.
17 * lisp.h (eval_sub): Declare.
18 * lread.c (readevalloop): Remove `evalfun' argument.
19 * print.c (Fwith_output_to_temp_buffer):
20 * data.c (Fsetq_default): Use eval_sub.
21
22 2010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
23
24 Make the effect of (defvar foo) local.
25 * eval.c (apply_lambda): Make static. Remove eval_flag arg.
26 (Fsetq): Don't check declared_special.
27 (Fdefun, Fdefmacro): Use Ffunction.
28 (Fdefvar): Don't set declared_special for (defvar foo).
29 (FletX): Check locally-special vars. Only do specbind once.
30 (Flet): Check locally-special vars.
31 (Feval): Don't check declared_special.
32 (funcall_lambda): Check locally-special vars.
33 * lisp.h (apply_lambda): Remove extern declaration.
34 * lread.c (readevalloop): CSE.
35
36 2010-07-23 Andreas Schwab <schwab@linux-m68k.org>
37
38 * eval.c (funcall_funvec): Replace bcopy by memcpy.
39
40 2010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
41
42 * eval.c (Fspecial_variable_p): Rename from `specialp'.
43
44 2010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
45
46 * bytecode.c (exec_byte_code):
47 * eval.c (Ffunctionp): Fix up int/Lisp_Object confusions.
48
49 2008-04-23 Miles Bader <miles@gnu.org>
50
51 * eval.c (Ffunctionp): Return nil for special forms.
52 (Qunevalled): New variable.
53 (syms_of_eval): Initialize it.
54
55 2007-10-18 Miles Bader <miles@gnu.org>
56
57 * eval.c (FletX): Test the type of VARLIST rather than just !NILP.
58 (Flet): Use XCAR instead of Fcar.
59
60 2007-10-16 Miles Bader <miles@gnu.org>
61
62 * alloc.c (make_funvec, Fpurecopy): Set the pseudo-vector type.
63
64 2006-02-10 Miles Bader <miles@gnu.org>
65
66 * eval.c (Ffunctionp): Supply new 2nd arg to Findirect_function.
67
68 2005-03-04 Miles Bader <miles@gnu.org>
69
70 * eval.c (FletX): Update Vinterpreter_lexical_environment for each
71 variable we bind, instead of all at once like `let'.
72
73 2004-08-09 Miles Bader <miles@gnu.org>
74
75 Changes from merging the funvec patch:
76
77 * eval.c (Feval, Ffuncall): Don't special-case vectors.
78 (funcall_lambda): Use FUNVEC_SIZE.
79 (Fcurry): Remove function.
80
81 Merge funvec patch.
82
83 2004-04-10 Miles Bader <miles@gnu.org>
84
85 * eval.c (Fspecialp): New function.
86 (syms_of_eval): Initialize it.
87
88 2004-04-03 Miles Bader <miles@gnu.org>
89
90 * eval.c (Feval): If a variable isn't bound lexically, fall back
91 to looking it up dynamically even if it isn't declared special.
92
93 2002-08-26 Miles Bader <miles@gnu.org>
94
95 * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it.
96
97 2002-06-12 Miles Bader <miles@gnu.org>
98
99 Lexical binding changes to the byte-code interpreter:
100
101 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, Bvec_ref, Bvec_set)
102 (BdiscardN): New constants.
103 (exec_byte_code): Rename from `Fbyte_code'.
104 Implement above new bytecodes.
105 Add ARGS-TEMPLATE, NARGS and ARGS parameters, and optionally use
106 them push initial args on the stack.
107 (Fbyte_code): New function, just call `exec_byte_code'.
108 Add additional optional arguments for `exec_byte_code'.
109 (Qand_optional, Qand_rest): New extern declarations.
110 * eval.c (Fcurry, Ffunctionp): New functions.
111 (syms_of_eval): Initialize them.
112 (funcall_lambda): Call `exec_byte_code' instead of Fbyte_code.
113 If a compiled-function object has a `push-args' slot, call the
114 byte-code interpreter without binding any arguments.
115 (Ffuncall): Add support for curried functions.
116 * lisp.h (Fbyte_code): Declare max-args as MANY.
117 (exec_byte_code): New declaration.
118
119 Lexical binding changes to the lisp interpreter:
120
121 * lisp.h (struct Lisp_Symbol): Add `declared_special' field.
122 (apply_lambda): Add new 3rd arg to decl.
123 * alloc.c (Fmake_symbol): Initialize `declared_special' field.
124 * eval.c (Vinterpreter_lexical_environment): New variable.
125 (syms_of_eval): Initialize it.
126 (Fsetq): Modify SYM's lexical binding if appropriate.
127 (Ffunction): Return a closure if within a lexical environment.
128 (Flet, FletX): Lexically bind non-defvar'd variables if inside a
129 lexical environment.
130 (Feval): Return lexical binding of variables, if they have one.
131 Pass current lexical environment to embedded lambdas. Handle closures.
132 (Ffuncall): Pass nil lexical environment to lambdas. Handle closures.
133 (funcall_lambda): Add new LEXENV argument, and lexically bind
134 arguments if it's non-nil. Bind `interpreter-lexenv' if it changed.
135 (apply_lambda): Add new LEXENV argument and pass it to funcall_lambda.
136 (Fdefvaralias, Fdefvar, Fdefconst): Mark the variable as special.
137 (Qinternal_interpreter_environment, Qclosure): New constants.
138 (syms_of_eval): Initialize them.
139 (Fdefun, Fdefmacro): Use a closure if lexical binding is active.
140 * lread.c (defvar_bool, defvar_lisp_nopro, defvar_per_buffer)
141 (defvar_kboard, defvar_int): Mark the variable as special.
142 (Vlexical_binding, Qlexical_binding): New variables.
143 (syms_of_lread): Initialize them.
144 (Fload): Bind `lexically-bound' to nil unless specified otherwise
145 in the file header.
146 (lisp_file_lexically_bound_p): New function.
147 (Qinternal_interpreter_environment): New variable.
148 * doc.c (Qclosure): New extern declaration.
149 (Fdocumentation, store_function_docstring): Handle interpreted
150 closures.
151
152 ;; arch-tag: 7cf884aa-6b48-40cb-bfca-265a1e99b3c5