* lisp/emacs-lisp/byte-lexbind.el: Delete.
[bpt/emacs.git] / lisp / ChangeLog
CommitLineData
ce5b520a
SM
12011-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/byte-lexbind.el: Delete.
4
5 * emacs-lisp/bytecomp.el (byte-compile-current-heap-environment)
6 (byte-compile-current-num-closures): Remove vars.
7 (byte-vec-ref, byte-vec-set): Remove byte codes.
8 (byte-compile-arglist-vars, byte-compile-make-lambda-lexenv): Move from
9 byte-lexbind.el.
10 (byte-compile-lambda): Never build a closure.
11 (byte-compile-closure-code-p, byte-compile-make-closure): Remove.
12 (byte-compile-closure): Simplify.
13 (byte-compile-top-level): Don't mess with heap environments.
14 (byte-compile-dynamic-variable-bind): Always maintain
15 byte-compile-bound-variables.
16 (byte-compile-variable-ref, byte-compile-variable-set): Always just use
17 the stack for lexical vars.
18 (byte-compile-push-binding-init): Simplify.
19 (byte-compile-not-lexical-var-p): New function, moved from cconv.el.
20 (byte-compile-bind, byte-compile-unbind): New functions, moved and
21 simplified from byte-lexbind.el.
22 (byte-compile-let, byte-compile-let*): Simplify.
23 (byte-compile-condition-case): Don't add :fun-body to the bound vars.
24 (byte-compile-defmacro): Simplify.
25
26 * emacs-lisp/cconv.el (cconv-not-lexical-var-p): Remove.
27 (cconv-freevars, cconv-analyse-function, cconv-analyse-form):
28 Use byte-compile-not-lexical-var-p instead.
29
30 * help-fns.el (describe-function-1): Fix paren typo.
31
32 * emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops)
33 (byte-optimize-lapcode): Remove byte-vec-ref and byte-vec-set.
34
295fb2ac
SM
352011-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
36
37 * emacs-lisp/cconv.el (cconv-closure-convert): Drop `toplevel' arg.
38 (cconv-closure-convert-toplevel): Remove.
39 (cconv-lookup-let): New fun.
40 (cconv-closure-convert-rec): Don't bother with defs-are-legal.
41 Use :fun-body to handle special forms that require closing their forms.
42
43 * emacs-lisp/bytecomp.el (byte-compile-file-form, byte-compile):
44 Use cconv-closure-convert instead of cconv-closure-convert-toplevel.
45 (byte-compile-lambda, byte-compile-make-closure):
46 * emacs-lisp/byte-lexbind.el (byte-compile-maybe-push-heap-environment):
47 Make sure cconv did its job.
48
49 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Check stack-depth
50 before using it.
51
52 * dired.el (dired-desktop-buffer-misc-data): Don't use a dynamic var as
53 function argument.
54
43e67019
SM
552011-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
56
57 * emacs-lisp/bytecomp.el (byte-compile-lambda): Fix `fun' that was not
58 renamed to `bytecomp-fun'.
59
60 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
61 Understand the :fun-body case for catch, save-window-excursion, and
62 condition-case.
63 (byte-compile-maybe-push-heap-environment): No need when nclosures is
64 zero and byte-compile-current-num-closures is -1.
65
66 * emacs-lisp/cconv.el (cconv-not-lexical-var-p): New function.
67 (cconv-freevars): Use it.
68 (cconv-closure-convert-rec): Avoid `position'.
69 (cconv-analyse-function): New function.
70 (cconv-analyse-form): Use it. `inclosure' can't be nil any more.
71 Check lexical vars at let-binding time rather than when referenced.
72 For defuns to be in an empty environment and lambdas to take lexical args.
73 Pay attention to the need to build closures in catch, unwind-protect,
74 save-window-excursion, condition-case, and track-mouse.
75 Fix defconst/defvar handling.
76
d779e73c
SM
772011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
78
79 * emacs-lisp/cconv.el (cconv-mutated, cconv-captured)
80 (cconv-captured+mutated, cconv-lambda-candidates): Fix up declaration.
81 (cconv-freevars): Minor cleanup. Fix handling of the error var in
82 condition-case.
83
84 * emacs-lisp/bytecomp.el (byte-compile-catch)
85 (byte-compile-unwind-protect, byte-compile-track-mouse)
86 (byte-compile-condition-case, byte-compile-save-window-excursion):
87 Provide a :fun-body alternative, so that info can be propagated from the
88 surrounding context, as is the case for lexical scoping.
89
94d11cb5
IK
902011-02-10 Igor Kuzmin <kuzminig@iro.umontreal.ca>
91
92 * emacs-lisp/cconv.el: New file.
93 * emacs-lisp/bytecomp.el: Use cconv.
94 (byte-compile-file-form, byte-compile):
95 Call cconv-closure-convert-toplevel when requested.
96 * server.el:
97 * mpc.el:
98 * emacs-lisp/pcase.el:
99 * doc-view.el:
100 * dired.el: Use lexical-binding.
101
590130fb
SM
1022010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
103
104 * emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
105
a0ee6f27
SM
1062010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
107
108 * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
109 * emacs-lisp/lisp-mode.el (eval-last-sexp-1, eval-defun-1):
110 * ielm.el (ielm-eval-input):
111 * simple.el (eval-expression): Use new eval arg to obey lexical-binding.
112
defb1411
SM
1132010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
114
115 * emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.
116
f07a954e
SM
1172010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
118
119 * subr.el (with-lexical-binding): Remove.
120
4a330052
SM
1212010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
122
123 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
124 specialp -> special-variable-p.
125
3c3ddb98
SM
1262010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
127
128 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
129 Don't macroexpand before evaluating in eval-and-compile, in case
130 `body's macro expansion uses macros and functions defined in itself.
131
f43cb649
SM
1322010-06-14 Stefan Monnier <monnier@iro.umontreal.ca>
133
134 * emacs-lisp/bytecomp.el (byte-compile-check-variable):
135 Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.
136
137 * Makefile.in (.el.elc): Increase max-lisp-eval-depth.
138
894e369d 1392006-12-04 Miles Bader <miles@gnu.org>
89877f5f 140
894e369d
SM
141 * Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
142 (compile, compile-always): Use it.
133a8d82 143
894e369d 1442005-10-24 Miles Bader <miles@gnu.org>
89877f5f 145
894e369d 146 * subr.el (functionp): Re-remove.
89877f5f 147
894e369d
SM
148 * emacs-lisp/bytecomp.el (byte-compile-closure): Add optional
149 ADD-LAMBDA argument, which we just pass to `byte-compile-lambda'.
150 (byte-compile-defun): Use ADD-LAMBDA arg to `byte-compile-closure'
151 instead of adding lambda ourselves.
9d1f18b5 152
894e369d 1532004-08-09 Miles Bader <miles@gnu.org>
9d1f18b5 154
894e369d 155 Changes from merging the funvec patch:
b81a0b56 156
894e369d
SM
157 * emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
158 instead of `vector' to create compiled closures.
b81a0b56 159
894e369d 160 Merge funvec patch.
b81a0b56 161
894e369d 1622004-04-29 Miles Bader <miles@gnu.org>
69f18acc 163
894e369d
SM
164 * emacs-lisp/bytecomp.el (byte-compile-top-level): Add new entries
165 to `byte-compile-lexical-environment' at the start, not end.
166 (byte-compile-delay-out): Correctly default STACK-ADJUST to zero.
5fee75d4 167
894e369d
SM
168 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
169 Don't crash on no-op lapcode entries (car is nil).
69f18acc 170
894e369d
SM
171 * emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
172 Push a lexvar onto lexenv, not a vinfo!
9766adfb 173
894e369d 1742004-04-11 Miles Bader <miles@gnu.org>
9766adfb 175
894e369d
SM
176 * emacs-lisp/bytecomp.el (byte-compile-top-level):
177 Correctly analyze lexically-bound arguments.
9766adfb 178
894e369d
SM
179 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
180 Use `append' instead of `nconc'.
56b2854f 181
894e369d
SM
182 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo):
183 Don't use backquote to make a mutable data-structure.
184 (byte-compile-lvarinfo-num-refs, byte-compile-lvarinfo-num-sets):
185 Rename to use `num-' instead of `num'.
186 (byte-compile-make-lambda-lexenv): Adjust accordingly.
56b2854f 187
894e369d 1882004-04-10 Miles Bader <miles@gnu.org>
6534e58a 189
894e369d
SM
190 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
191 Look at variable's global specialp state too.
d6ceb380 192
894e369d 1932004-04-09 Miles Bader <miles@gnu.org>
d6ceb380 194
894e369d
SM
195 * emacs-lisp/byte-opt.el (byte-optimize-lapcode):
196 Default initial-stack-depth to 0.
197 (byte-optimize-lapcode): Discard the right number of values in
198 the stack-set+discard-->discard optimization.
c760f19e 199
894e369d 2002004-04-02 Miles Bader <miles@gnu.org>
2e9b968b 201
894e369d
SM
202 * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
203 environment if lexical-binding is enabled.
2e9b968b 204
894e369d 2052003-10-14 Miles Bader <miles@gnu.org>
6d00ce04 206
894e369d
SM
207 * emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
208 `backquote-list*' to avoid stack overflows.
baf1a55e 209
894e369d 2102003-04-04 Miles Bader <miles@gnu.org>
6ee21b07 211
894e369d 212 * help-fns.el (help-function-arglist): Handle interpreted closures.
f0dbdc25 213
894e369d 2142002-11-20 Miles Bader <miles@gnu.org>
f0dbdc25 215
894e369d
SM
216 * emacs-lisp/bytecomp.el (byte-compile-stack-adjustment):
217 Correctly handle discardN* operators.
218 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Fix stack-depth
219 tracking errors.
e044e4fc 220
894e369d 2212002-08-26 Miles Bader <miles@gnu.org>
e044e4fc 222
894e369d
SM
223 * international/mule.el (make-char): Macroexpand call to
224 charset-id constructed by `byte-compile' hook.
2e9b968b 225
894e369d 226 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
2e9b968b 227
894e369d
SM
228 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params): New macro.
229 (byte-optimize-lapcode): Keep track of stack-depth in final pass too.
230 Add more optimizations for lexical binding.
231 (byte-compile-inline-expand): Macroexpand result of inlining.
baf1a55e 232
894e369d
SM
233 * emacs-lisp/bytecomp.el (byte-compile-lambda): Update call to
234 byte-compile-closure-initial-lexenv-p.
235 (byte-discardN-preserve-tos): Alias to byte-discardN.
236 (byte-compile-push-binding-init): Don't push unused variables on
237 init-lexenv.
238 (byte-compile-push-binding-init): Don't use LFORMINFO if it's nil.
239 (byte-compile-lambda): Don't look at lexical environment unless
240 we're using lexical binding.
241 (byte-compile-defmacro): Correctly generate macros.
242
243 * emacs-lisp/byte-lexbind.el (byte-compile-unbind): Optimize the
244 dynamic-bindings-only case.
245 (byte-compile-bind): Don't special-case unused lexical variables.
246
247 * emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.
248
2492002-08-19 Miles Bader <miles@gnu.org>
250
251 * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
252 Handle `byte-discardN-preserve-tos' pseudo-op.
253 (byte-compile-side-effect-and-error-free-ops): Add `byte-stack-ref'.
254 (byte-compile-side-effect-free-ops): Add `byte-vec-ref'.
255 (byte-optimize-lapcode): Add some cases for stack-set/ref ops.
256 Add tracking of stack-depth. Unfinished code to collapse
257 lexical-unbinding sequences.
258
259 * emacs-lisp/bytecomp.el (byte-compile-lapcode):
260 Handle `byte-discardN-preserve-tos' pseudo-op.
261 (byte-compile-top-level): If there are lexical args, output a TAG
262 op to record the initial stack-depth for the optimizer.
263
2642002-08-17 Miles Bader <miles@gnu.org>
265
266 * emacs-lisp/bytecomp.el (byte-discardN): Add byte-defop.
267 (byte-compile-lapcode): Include byte-discardN.
268 (byte-compile-lambda): Fixup closure detection.
269 (byte-compile-top-level): Handle arguments for a lexical lambda.
270 (byte-compile-lexical-variable-ref, byte-compile-variable-ref)
271 (byte-compile-variable-set): Use byte-compile-stack-set/ref.
272 (byte-compile-discard): Add new parameters NUM and PRESERVE-TOS.
273 (byte-compile-stack-ref, byte-compile-stack-set): New functions.
274 (byte-compile-push-binding-init): Get the variable list properly
275 from LFORMINFO.
276
277 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
278 Ignore setq'd variables we're not interested in.
279 (byte-compile-make-lambda-lexenv): Add assertion that closed-over
280 variables be heap allocated.
281 (byte-compile-closure-initial-lexenv-p): Rename from
282 byte-compile-closure-lexenv-p.
283 (byte-compile-non-stack-bindings-p): Get the variable list
284 properly from LFORMINFO.
285 (byte-compile-maybe-push-heap-environment): Handle the
286 no-closed-over-variables case correctly.
287 (byte-compile-bind): Use byte-compile-stack-set/ref.
288 Don't bother modifying INIT-LEXENV as no one will see the changes.
289 (byte-compile-unbind): Call `byte-compile-discard' to handle
290 unbinding lexical bindings.
291
292 * emacs-lisp/disass.el (disassemble-internal): Handle closures.
293 (disassemble-1): Handle new bytecodes.
294 * emacs-lisp/byte-opt.el (disassemble-offset): Handle new bytecodes.
295
2962002-06-16 Miles Bader <miles@gnu.org>
297
298 * emacs-lisp/macroexp.el (macroexp-accumulate): New macro.
299 (macroexpand-all-forms, macroexpand-all-clauses): Use it.
300 * Makefile.in (compile): Undo previous change.
301
3022002-06-14 Miles Bader <miles@gnu.org>
303
304 * Makefile.in (COMPILE_FIRST): Add `emacs-lisp/macroexp.el'.
305 (compile): Add a special case that compiles `emacs-lisp/macroexp.el'
306 with an increased max-lisp-eval-depth.
307
308 * emacs-lisp/bytecomp.el: Provide `bytecomp-preload', at the
309 beginning of the file. Require `byte-lexbind' at compile time.
310 Add a few doc string.
311 (byte-compile-push-bytecodes)
312 (byte-compile-push-bytecode-const2): New macros.
313 (byte-compile-lapcode): Use them. Do general code cleanup.
314 (byte-compile-initial-macro-environment): Expand macros in
315 byte-compile-eval before passing to byte-compile-top-level.
316 (byte-compile): Use the `byte-compile-initial-macro-environment'.
317
318 * emacs-lisp/byte-lexbind.el: Require `bytecomp-preload' instead of
319 `bytecomp'.
320 (byte-compile-bind): Use `byte-compile-dynamic-variable-bind' to bind
321 dynamic variables.
322 (byte-compile-maybe-push-heap-environment): Fix function name typo.
323
3242002-06-13 Miles Bader <miles@gnu.org>
325
326 Byte compiler lexical binding support (not finished yet):
327 * emacs-lisp/bytecomp.el: Require `macroexp'.
328 (byte-compile-lexical-environment)
329 (byte-compile-current-heap-environment)
330 (byte-compile-current-num-closures): New variables.
331 (0, 178, 179, 180, 181): New byte-opcodes.
332 (byte-compile-lapcode): Handle stack-ref/set opcodes. Signal an
333 error if a delay-output placeholder is not filled in yet.
334 (byte-compile-file-form, byte-compile): Expand all macros with
335 `macroexpand-all'.
336 (byte-compile-file-form-defsubst, byte-compile-form): Don't expand
337 macros here.
338 (byte-compile-make-lambda-lexenv): Autoload.
339 (byte-compile-lambda): Initial code for handling lexically-bound
340 arguments and closures; doesn't work yet.
341 (byte-compile-closure-code-p, byte-compile-make-closure)
342 (byte-compile-closure): New functions.
343 (byte-compile-check-variable, byte-compile-dynamic-variable-op)
344 (byte-compile-dynamic-variable-bind)
345 (byte-compile-lexical-variable-ref, byte-compile-variable-set):
baf1a55e 346 New functions.
894e369d
SM
347 (byte-compile-variable-ref): Remove second argument. Now only
348 handles real variable references (not setting or binding).
349 (byte-compile-push-unknown-constant)
350 (byte-compile-resolve-unknown-constant): New functions.
351 (byte-compile-funarg, byte-compile-funarg-2): Functions removed.
352 (byte-compile-function-form): Use either `byte-compile-constant'
353 or `byte-compile-closure'.
354 (byte-compile-setq): Use `byte-compile-variable-set' instead of
355 `byte-compile-variable-ref'.
356 (apply, mapcar, mapatoms, mapconcat, mapc, sort):
357 `byte-defop-compiler-1's removed.
358 (byte-compile-while): Make sure lexically-bound variables inside
359 the loop don't get stored in an environment outside the loop.
360 (byte-compile-compute-lforminfo): Autoload.
361 (byte-compile-push-binding-init): New function.
362 (byte-compile-let, byte-compile-let*): Handle lexical binding.
363 (byte-compile-defun): Use `byte-compile-closure' to do the work.
364 (byte-compile-defmacro): Use `byte-compile-make-closure'.
365 (byte-compile-defvar): Expand the generated call to `push' since
366 we're past macroexpansion already.
367 (byte-compile-stack-adjustment): New function.
368 (byte-compile-out): Make second arg optional. Rewrite for clarity.
369 (byte-compile-delay-out, byte-compile-delayed-out): New functions.
370
371 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
372 Don't expand macros here.
373
374 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.
375
376 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo)
377 (byte-compile-lforminfo-add-var)
378 (byte-compile-lforminfo-note-closure)
379 (byte-compile-compute-lforminfo)
380 (byte-compile-lforminfo-from-lambda)
381 (byte-compile-lforminfo-analyze)
382 (byte-compile-heapenv-add-accessible-env)
383 (byte-compile-heapenv-ensure-access)
384 (byte-compile-rearrange-let-clauses, byte-compile-bind)
385 (byte-compile-unbind): Fix a bunch of typos.
386
3872002-06-12 Miles Bader <miles@gnu.org>
388
389 * emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.
390
391 * subr.el (functionp): Function removed (now a subr).
392 * help-fns.el (describe-function-1): Handle interpreted closures.
393
394;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70