1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

20 Commits

Author SHA1 Message Date
Stefan Monnier
ca1055060d Remove bytecomp- prefix, plus misc changes.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Make it work to
inline lexbind interpreted functions into lexbind code.
(bytedecomp-bytes): Not a dynamic var any more.
(disassemble-offset): Get the bytes via an argument instead.
(byte-decompile-bytecode-1): Use push.
* lisp/emacs-lisp/bytecomp.el: Remove the bytecomp- prefix now that we use
lexical-binding.
(byte-compile-outbuffer): Rename from bytecomp-outbuffer.
* lisp/emacs-lisp/cl-macs.el (load-time-value):
* lisp/emacs-lisp/cl.el (cl-compiling-file): Adjust to new name.
* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Add byte-code-function-p.
(pcase--u1): Remove left-over code from early development.
Fix case of variable shadowing in guards and predicates.
(pcase--u1): Add a new `let' pattern.
* src/image.c (parse_image_spec): Use Ffunctionp.
* src/lisp.h: Declare Ffunctionp.
2011-03-16 16:08:39 -04:00
Stefan Monnier
0d6459dfb5 Merge from trunk 2011-03-06 16:22:16 -05:00
Stefan Monnier
e2abe5a13d Fix pcase memoizing; change lexbound byte-code marker.
* src/bytecode.c (exec_byte_code): Remove old lexical binding slot handling
and replace it with the a integer args-desc handling.
* eval.c (funcall_lambda): Adjust arglist test accordingly.
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature):
Handle integer arglist descriptor.
(byte-compile-make-args-desc): Make integer arglist descriptor.
(byte-compile-lambda): Use integer arglist descriptor to mark lexical
byte-coded functions instead of an extra slot.
* lisp/help-fns.el (help-add-fundoc-usage): Don't add a dummy doc.
(help-split-fundoc): Return a nil doc if there was no actual doc.
(help-function-arglist): Generate an arglist from an integer arg-desc.
* lisp/emacs-lisp/pcase.el (pcase--memoize): Rename from pcase-memoize;
Make only the key weak.
(pcase): Change the key used in the memoization table, so it does not
always get GC'd away.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Slight change to the
pcase pattern to generate slightly better code.
2011-03-05 23:48:17 -05:00
Stefan Monnier
d032d5e7df * doc/lispref/variables.texi (Scope): Mention the availability of lexbind.
(Lexical Binding): New node.
* doc/lispref/eval.texi (Eval): Add `eval's new `lexical' arg.
* lisp/emacs-lisp/cconv.el (cconv-liftwhen): Increase threshold.
(cconv-closure-convert-rec): Convert interactive spec in empty lexenv.
(cconv-analyse-use): Improve unused vars warnings.
(cconv-analyse-form): Analyze interactive spec in empty lexenv.
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Always byte-compile
the interactive spec in lexical-binding mode.
(byte-compile-refresh-preloaded): Don't reload byte-compiler files.
* lisp/custom.el (custom-initialize-default): Use defvar.
(custom-declare-variable): Set the special-variable-p flag.
* lisp/help-fns.el (help-make-usage): Drop leading underscores.
* lisp/dired.el (dired-revert, dired-make-relative): Mark unused args.
(dired-unmark-all-files): Remove unused var `query'.
(dired-overwrite-confirmed): Declare.
(dired-restore-desktop-buffer): Don't use dynamically scoped arg names.
* lisp/mpc.el: Mark unused args.
(mpc--faster-toggle): Remove unused var `songnb'.
* lisp/server.el (server-kill-buffer-running): Move before first use.
* lisp/minibuffer.el: Mark unused args.
* src/callint.c (quotify_arg): Simplify the logic.
(Fcall_interactively): Use lexical binding when evaluating the
interactive spec of a lexically bound function.
2011-03-01 00:03:24 -05:00
Juanma Barranquero
ca3afb79d0 lisp/emacs-lisp/pcase.el (pcase, pcase--u1, pcase--q1): Fix typos in docstrings. 2011-02-28 05:24:40 +01:00
Stefan Monnier
1f0816b69d * lisp/emacs-lisp/pcase.el (pcase--if): Try to invert test to reduce depth.
(pcase-mutually-exclusive-predicates): New var.
(pcase--split-consp, pcase--split-pred): Use it.
(pcase--split-equal, pcase--split-member): When splitting against
a pure predicate, run it to know the outcome.
(pcase--u1): Mark vars that are actually used.
(pcase--q1): Avoid introducing unused vars.
2011-02-26 21:50:38 -05:00
Stefan Monnier
f619ad4ca2 Merge from trunk 2011-02-21 17:34:51 -05:00
Stefan Monnier
9a05edc4fc * lisp/emacs-lisp/pcase.el (pcase--expand, pcase--u, pcase--u1, pcase--q1):
Avoid destructuring-bind which results in poorer code.
2011-02-18 08:55:51 -05:00
Stefan Monnier
f9d554dd46 * lisp/emacs-lisp/pcase.el (pcase--u1): Understand non-linear patterns. 2011-02-17 23:58:21 -05:00
Stefan Monnier
b38b1ec071 Various compiler bug-fixes. MPC seems to run correctly now.
* lisp/files.el (lexical-binding): Add a safe-local-variable property.

* lisp/emacs-lisp/byte-opt.el (byte-inline-lapcode): Check how many elements
are added to the stack.
(byte-compile-splice-in-already-compiled-code): Don't touch lexical nor
byte-compile-depth now that byte-inline-lapcode does it for us.
(byte-compile-inline-expand): Don't inline dynbind byte code into
lexbind code, since it has to be done differently.

* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
Correctly extract arglist from `closure's.
(byte-compile-cl-warn): Compiler-macros are run earlier now.
(byte-compile-top-level): Bind byte-compile-lexical-environment to nil,
except for lambdas.
(byte-compile-form): Don't run the compiler-macro expander here.
(byte-compile-let): Merge with byte-compile-let*.
Don't preserve-body-value if the body's value was discarded.

* lisp/emacs-lisp/cconv.el (cconv--set-diff, cconv--set-diff-map)
(cconv--map-diff, cconv--map-diff-elem, cconv--map-diff-set): New funs.
(cconv--env-var): New constant.
(cconv-closure-convert-rec): Use it and use them.  Fix a typo that
ended up forgetting to remove entries from lmenvs in `let'.
For `lambda' use the outer `fvrs' when building the closure and don't
forget to remove `vars' from the `emvrs' and `lmenvs' of the body.

* lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block): Disable optimization
in lexbind, because it needs a different implementation.

* src/bytecode.c (exec_byte_code): Fix handling of &rest.

* src/eval.c (Vinternal_interpreter_environment): Remove.
(syms_of_eval): Do declare Vinternal_interpreter_environment as
a global lisp var, but unintern it to hide it.
(Fcommandp):
* src/data.c (Finteractive_form): Understand `closure's.
2011-02-17 16:19:13 -05:00
Igor Kuzmin
94d11cb577 * lisp/emacs-lisp/cconv.el: New file.
* lisp/emacs-lisp/bytecomp.el: Use cconv.
(byte-compile-file-form, byte-compile):
Call cconv-closure-convert-toplevel when requested.
* lisp/server.el:
* lisp/mpc.el:
* lisp/emacs-lisp/pcase.el:
* lisp/doc-view.el:
* lisp/dired.el: Use lexical-binding.
2011-02-10 13:53:49 -05:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
d0d4361dba Add 2011 to remaining FSF/AIST copyright years. 2011-01-15 14:10:37 -08:00
Stefan Monnier
872ab16459 * lisp/emacs-lisp/pcase.el: Improve pcase-let. Use "pcase--" prefix.
(pcase--dontcare-upats): New var.
(pcase-let, pcase-let*): Generate better code.
Accept the same bodies as `let'.
(pcase-dolist): New macro.
(pcase--trivial-upat-p): New helper function.
(pcase--expand): Strip leading "(let nil" if any.
2010-11-24 11:39:51 -05:00
Stefan Monnier
aa31025710 * lisp/emacs-lisp/pcase.el (pcase-let*, pcase-let): Add debug and
indentation specs.
2010-11-11 20:35:06 -05:00
Stefan Monnier
dcc029e017 * lisp/emacs-lisp/pcase.el (pcase): New string' and guard' patterns.
(pcase-if): Add one minor optimization.
(pcase-split-equal): Rename from pcase-split-eq.
(pcase-split-member): Rename from pcase-split-memq.
(pcase-u1): Add strings to the member optimization.
Add `guard' variant of predicates.
(pcase-q1): Add string patterns.
2010-10-28 21:05:38 -04:00
Stefan Monnier
15413fb428 * lisp/emacs-lisp/pcase.el (pcase-let*, pcase-let): plet -> pcase-let. 2010-09-27 00:42:53 +02:00
Stefan Monnier
4de81ee0d2 * lisp/emacs-lisp/pcase.el (pcase-split-memq): Overenthusiastic optimisation.
(pcase-u1): Handle the case of a lambda pred.
2010-09-01 12:03:08 +02:00
Glenn Morris
97eedd1b1f * lisp/emacs-lisp/pcase.el: Fix copyright header. 2010-08-10 19:14:53 -07:00
Stefan Monnier
d02c9bcd09 * lisp/emacs-lisp/pcase.el: New file. 2010-08-10 15:18:14 +02:00