* lisp/emacs-lisp/bytecomp.el (byte-compile-catch)
[emacs.git] / lisp / ChangeLog
blob7c920b2eadccb547c84d53ac05dcff9db6de3392
1 2011-02-10  Stefan Monnier  <monnier@iro.umontreal.ca>
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.
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.
14 2011-02-10  Igor Kuzmin  <kuzminig@iro.umontreal.ca>
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.
26 2010-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>
28         * emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
30 2010-12-15  Stefan Monnier  <monnier@iro.umontreal.ca>
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.
37 2010-12-14  Stefan Monnier  <monnier@iro.umontreal.ca>
39         * emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.
41 2010-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
43         * subr.el (with-lexical-binding): Remove.
45 2010-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
47         * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
48         specialp -> special-variable-p.
50 2010-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
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.
56 2010-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>
58         * emacs-lisp/bytecomp.el (byte-compile-check-variable):
59         Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.
61         * Makefile.in (.el.elc): Increase max-lisp-eval-depth.
63 2006-12-04  Miles Bader  <miles@gnu.org>
65         * Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
66         (compile, compile-always): Use it.
68 2005-10-24  Miles Bader  <miles@gnu.org>
70         * subr.el (functionp): Re-remove.
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.
77 2004-08-09  Miles Bader  <miles@gnu.org>
79         Changes from merging the funvec patch:
81         * emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
82         instead of `vector' to create compiled closures.
84         Merge funvec patch.
86 2004-04-29  Miles Bader  <miles@gnu.org>
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.
92         * emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
93         Don't crash on no-op lapcode entries (car is nil).
95         * emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
96         Push a lexvar onto lexenv, not a vinfo!
98 2004-04-11  Miles Bader  <miles@gnu.org>
100         * emacs-lisp/bytecomp.el (byte-compile-top-level):
101         Correctly analyze lexically-bound arguments.
103         * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
104         Use `append' instead of `nconc'.
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.
112 2004-04-10  Miles Bader  <miles@gnu.org>
114         * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
115         Look at variable's global specialp state too.
117 2004-04-09  Miles Bader  <miles@gnu.org>
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.
124 2004-04-02  Miles Bader  <miles@gnu.org>
126         * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
127         environment if lexical-binding is enabled.
129 2003-10-14  Miles Bader  <miles@gnu.org>
131         * emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
132         `backquote-list*' to avoid stack overflows.
134 2003-04-04  Miles Bader  <miles@gnu.org>
136         * help-fns.el (help-function-arglist): Handle interpreted closures.
138 2002-11-20  Miles Bader  <miles@gnu.org>
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.
145 2002-08-26  Miles Bader  <miles@gnu.org>
147         * international/mule.el (make-char): Macroexpand call to
148         charset-id constructed by `byte-compile' hook.
150         * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
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.
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.
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.
171         * emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.
173 2002-08-19  Miles Bader  <miles@gnu.org>
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.
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.
188 2002-08-17  Miles Bader  <miles@gnu.org>
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.
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.
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.
220 2002-06-16  Miles Bader  <miles@gnu.org>
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.
226 2002-06-14  Miles Bader  <miles@gnu.org>
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.
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'.
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.
248 2002-06-13  Miles Bader  <miles@gnu.org>
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):
270         New functions.
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.
295         * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
296         Don't expand macros here.
298         * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.
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.
311 2002-06-12  Miles Bader  <miles@gnu.org>
313         * emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.
315         * subr.el (functionp): Function removed (now a subr).
316         * help-fns.el (describe-function-1): Handle interpreted closures.
318 ;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70