Obey lexical-binding in interactive evaluation commands.
[bpt/emacs.git] / lisp / ChangeLog
CommitLineData
a0ee6f27
SM
12010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
4 * emacs-lisp/lisp-mode.el (eval-last-sexp-1, eval-defun-1):
5 * ielm.el (ielm-eval-input):
6 * simple.el (eval-expression): Use new eval arg to obey lexical-binding.
7
defb1411
SM
82010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
9
10 * emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.
11
f07a954e
SM
122010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
13
14 * subr.el (with-lexical-binding): Remove.
15
4a330052
SM
162010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
19 specialp -> special-variable-p.
20
3c3ddb98
SM
212010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
22
23 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
24 Don't macroexpand before evaluating in eval-and-compile, in case
25 `body's macro expansion uses macros and functions defined in itself.
26
f43cb649
SM
272010-06-14 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * emacs-lisp/bytecomp.el (byte-compile-check-variable):
30 Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.
31
32 * Makefile.in (.el.elc): Increase max-lisp-eval-depth.
33
894e369d 342006-12-04 Miles Bader <miles@gnu.org>
89877f5f 35
894e369d
SM
36 * Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
37 (compile, compile-always): Use it.
133a8d82 38
894e369d 392005-10-24 Miles Bader <miles@gnu.org>
89877f5f 40
894e369d 41 * subr.el (functionp): Re-remove.
89877f5f 42
894e369d
SM
43 * emacs-lisp/bytecomp.el (byte-compile-closure): Add optional
44 ADD-LAMBDA argument, which we just pass to `byte-compile-lambda'.
45 (byte-compile-defun): Use ADD-LAMBDA arg to `byte-compile-closure'
46 instead of adding lambda ourselves.
9d1f18b5 47
894e369d 482004-08-09 Miles Bader <miles@gnu.org>
9d1f18b5 49
894e369d 50 Changes from merging the funvec patch:
b81a0b56 51
894e369d
SM
52 * emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
53 instead of `vector' to create compiled closures.
b81a0b56 54
894e369d 55 Merge funvec patch.
b81a0b56 56
894e369d 572004-04-29 Miles Bader <miles@gnu.org>
69f18acc 58
894e369d
SM
59 * emacs-lisp/bytecomp.el (byte-compile-top-level): Add new entries
60 to `byte-compile-lexical-environment' at the start, not end.
61 (byte-compile-delay-out): Correctly default STACK-ADJUST to zero.
5fee75d4 62
894e369d
SM
63 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
64 Don't crash on no-op lapcode entries (car is nil).
69f18acc 65
894e369d
SM
66 * emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
67 Push a lexvar onto lexenv, not a vinfo!
9766adfb 68
894e369d 692004-04-11 Miles Bader <miles@gnu.org>
9766adfb 70
894e369d
SM
71 * emacs-lisp/bytecomp.el (byte-compile-top-level):
72 Correctly analyze lexically-bound arguments.
9766adfb 73
894e369d
SM
74 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
75 Use `append' instead of `nconc'.
56b2854f 76
894e369d
SM
77 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo):
78 Don't use backquote to make a mutable data-structure.
79 (byte-compile-lvarinfo-num-refs, byte-compile-lvarinfo-num-sets):
80 Rename to use `num-' instead of `num'.
81 (byte-compile-make-lambda-lexenv): Adjust accordingly.
56b2854f 82
894e369d 832004-04-10 Miles Bader <miles@gnu.org>
6534e58a 84
894e369d
SM
85 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
86 Look at variable's global specialp state too.
d6ceb380 87
894e369d 882004-04-09 Miles Bader <miles@gnu.org>
d6ceb380 89
894e369d
SM
90 * emacs-lisp/byte-opt.el (byte-optimize-lapcode):
91 Default initial-stack-depth to 0.
92 (byte-optimize-lapcode): Discard the right number of values in
93 the stack-set+discard-->discard optimization.
c760f19e 94
894e369d 952004-04-02 Miles Bader <miles@gnu.org>
2e9b968b 96
894e369d
SM
97 * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
98 environment if lexical-binding is enabled.
2e9b968b 99
894e369d 1002003-10-14 Miles Bader <miles@gnu.org>
6d00ce04 101
894e369d
SM
102 * emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
103 `backquote-list*' to avoid stack overflows.
baf1a55e 104
894e369d 1052003-04-04 Miles Bader <miles@gnu.org>
6ee21b07 106
894e369d 107 * help-fns.el (help-function-arglist): Handle interpreted closures.
f0dbdc25 108
894e369d 1092002-11-20 Miles Bader <miles@gnu.org>
f0dbdc25 110
894e369d
SM
111 * emacs-lisp/bytecomp.el (byte-compile-stack-adjustment):
112 Correctly handle discardN* operators.
113 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Fix stack-depth
114 tracking errors.
e044e4fc 115
894e369d 1162002-08-26 Miles Bader <miles@gnu.org>
e044e4fc 117
894e369d
SM
118 * international/mule.el (make-char): Macroexpand call to
119 charset-id constructed by `byte-compile' hook.
2e9b968b 120
894e369d 121 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
2e9b968b 122
894e369d
SM
123 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params): New macro.
124 (byte-optimize-lapcode): Keep track of stack-depth in final pass too.
125 Add more optimizations for lexical binding.
126 (byte-compile-inline-expand): Macroexpand result of inlining.
baf1a55e 127
894e369d
SM
128 * emacs-lisp/bytecomp.el (byte-compile-lambda): Update call to
129 byte-compile-closure-initial-lexenv-p.
130 (byte-discardN-preserve-tos): Alias to byte-discardN.
131 (byte-compile-push-binding-init): Don't push unused variables on
132 init-lexenv.
133 (byte-compile-push-binding-init): Don't use LFORMINFO if it's nil.
134 (byte-compile-lambda): Don't look at lexical environment unless
135 we're using lexical binding.
136 (byte-compile-defmacro): Correctly generate macros.
137
138 * emacs-lisp/byte-lexbind.el (byte-compile-unbind): Optimize the
139 dynamic-bindings-only case.
140 (byte-compile-bind): Don't special-case unused lexical variables.
141
142 * emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.
143
1442002-08-19 Miles Bader <miles@gnu.org>
145
146 * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
147 Handle `byte-discardN-preserve-tos' pseudo-op.
148 (byte-compile-side-effect-and-error-free-ops): Add `byte-stack-ref'.
149 (byte-compile-side-effect-free-ops): Add `byte-vec-ref'.
150 (byte-optimize-lapcode): Add some cases for stack-set/ref ops.
151 Add tracking of stack-depth. Unfinished code to collapse
152 lexical-unbinding sequences.
153
154 * emacs-lisp/bytecomp.el (byte-compile-lapcode):
155 Handle `byte-discardN-preserve-tos' pseudo-op.
156 (byte-compile-top-level): If there are lexical args, output a TAG
157 op to record the initial stack-depth for the optimizer.
158
1592002-08-17 Miles Bader <miles@gnu.org>
160
161 * emacs-lisp/bytecomp.el (byte-discardN): Add byte-defop.
162 (byte-compile-lapcode): Include byte-discardN.
163 (byte-compile-lambda): Fixup closure detection.
164 (byte-compile-top-level): Handle arguments for a lexical lambda.
165 (byte-compile-lexical-variable-ref, byte-compile-variable-ref)
166 (byte-compile-variable-set): Use byte-compile-stack-set/ref.
167 (byte-compile-discard): Add new parameters NUM and PRESERVE-TOS.
168 (byte-compile-stack-ref, byte-compile-stack-set): New functions.
169 (byte-compile-push-binding-init): Get the variable list properly
170 from LFORMINFO.
171
172 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
173 Ignore setq'd variables we're not interested in.
174 (byte-compile-make-lambda-lexenv): Add assertion that closed-over
175 variables be heap allocated.
176 (byte-compile-closure-initial-lexenv-p): Rename from
177 byte-compile-closure-lexenv-p.
178 (byte-compile-non-stack-bindings-p): Get the variable list
179 properly from LFORMINFO.
180 (byte-compile-maybe-push-heap-environment): Handle the
181 no-closed-over-variables case correctly.
182 (byte-compile-bind): Use byte-compile-stack-set/ref.
183 Don't bother modifying INIT-LEXENV as no one will see the changes.
184 (byte-compile-unbind): Call `byte-compile-discard' to handle
185 unbinding lexical bindings.
186
187 * emacs-lisp/disass.el (disassemble-internal): Handle closures.
188 (disassemble-1): Handle new bytecodes.
189 * emacs-lisp/byte-opt.el (disassemble-offset): Handle new bytecodes.
190
1912002-06-16 Miles Bader <miles@gnu.org>
192
193 * emacs-lisp/macroexp.el (macroexp-accumulate): New macro.
194 (macroexpand-all-forms, macroexpand-all-clauses): Use it.
195 * Makefile.in (compile): Undo previous change.
196
1972002-06-14 Miles Bader <miles@gnu.org>
198
199 * Makefile.in (COMPILE_FIRST): Add `emacs-lisp/macroexp.el'.
200 (compile): Add a special case that compiles `emacs-lisp/macroexp.el'
201 with an increased max-lisp-eval-depth.
202
203 * emacs-lisp/bytecomp.el: Provide `bytecomp-preload', at the
204 beginning of the file. Require `byte-lexbind' at compile time.
205 Add a few doc string.
206 (byte-compile-push-bytecodes)
207 (byte-compile-push-bytecode-const2): New macros.
208 (byte-compile-lapcode): Use them. Do general code cleanup.
209 (byte-compile-initial-macro-environment): Expand macros in
210 byte-compile-eval before passing to byte-compile-top-level.
211 (byte-compile): Use the `byte-compile-initial-macro-environment'.
212
213 * emacs-lisp/byte-lexbind.el: Require `bytecomp-preload' instead of
214 `bytecomp'.
215 (byte-compile-bind): Use `byte-compile-dynamic-variable-bind' to bind
216 dynamic variables.
217 (byte-compile-maybe-push-heap-environment): Fix function name typo.
218
2192002-06-13 Miles Bader <miles@gnu.org>
220
221 Byte compiler lexical binding support (not finished yet):
222 * emacs-lisp/bytecomp.el: Require `macroexp'.
223 (byte-compile-lexical-environment)
224 (byte-compile-current-heap-environment)
225 (byte-compile-current-num-closures): New variables.
226 (0, 178, 179, 180, 181): New byte-opcodes.
227 (byte-compile-lapcode): Handle stack-ref/set opcodes. Signal an
228 error if a delay-output placeholder is not filled in yet.
229 (byte-compile-file-form, byte-compile): Expand all macros with
230 `macroexpand-all'.
231 (byte-compile-file-form-defsubst, byte-compile-form): Don't expand
232 macros here.
233 (byte-compile-make-lambda-lexenv): Autoload.
234 (byte-compile-lambda): Initial code for handling lexically-bound
235 arguments and closures; doesn't work yet.
236 (byte-compile-closure-code-p, byte-compile-make-closure)
237 (byte-compile-closure): New functions.
238 (byte-compile-check-variable, byte-compile-dynamic-variable-op)
239 (byte-compile-dynamic-variable-bind)
240 (byte-compile-lexical-variable-ref, byte-compile-variable-set):
baf1a55e 241 New functions.
894e369d
SM
242 (byte-compile-variable-ref): Remove second argument. Now only
243 handles real variable references (not setting or binding).
244 (byte-compile-push-unknown-constant)
245 (byte-compile-resolve-unknown-constant): New functions.
246 (byte-compile-funarg, byte-compile-funarg-2): Functions removed.
247 (byte-compile-function-form): Use either `byte-compile-constant'
248 or `byte-compile-closure'.
249 (byte-compile-setq): Use `byte-compile-variable-set' instead of
250 `byte-compile-variable-ref'.
251 (apply, mapcar, mapatoms, mapconcat, mapc, sort):
252 `byte-defop-compiler-1's removed.
253 (byte-compile-while): Make sure lexically-bound variables inside
254 the loop don't get stored in an environment outside the loop.
255 (byte-compile-compute-lforminfo): Autoload.
256 (byte-compile-push-binding-init): New function.
257 (byte-compile-let, byte-compile-let*): Handle lexical binding.
258 (byte-compile-defun): Use `byte-compile-closure' to do the work.
259 (byte-compile-defmacro): Use `byte-compile-make-closure'.
260 (byte-compile-defvar): Expand the generated call to `push' since
261 we're past macroexpansion already.
262 (byte-compile-stack-adjustment): New function.
263 (byte-compile-out): Make second arg optional. Rewrite for clarity.
264 (byte-compile-delay-out, byte-compile-delayed-out): New functions.
265
266 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
267 Don't expand macros here.
268
269 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.
270
271 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo)
272 (byte-compile-lforminfo-add-var)
273 (byte-compile-lforminfo-note-closure)
274 (byte-compile-compute-lforminfo)
275 (byte-compile-lforminfo-from-lambda)
276 (byte-compile-lforminfo-analyze)
277 (byte-compile-heapenv-add-accessible-env)
278 (byte-compile-heapenv-ensure-access)
279 (byte-compile-rearrange-let-clauses, byte-compile-bind)
280 (byte-compile-unbind): Fix a bunch of typos.
281
2822002-06-12 Miles Bader <miles@gnu.org>
283
284 * emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.
285
286 * subr.el (functionp): Function removed (now a subr).
287 * help-fns.el (describe-function-1): Handle interpreted closures.
288
289;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70