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