1. 13 Sep, 2014 1 commit
  2. 06 Sep, 2014 1 commit
    • Leo Liu's avatar
      Add vector qpattern to pcase · e872d52c
      Leo Liu authored
      * doc/lispref/control.texi (Pattern matching case statement): Document vector
      qpattern. 
      
      * etc/NEWS: Mention vector qpattern for pcase.  (Bug#18327).
      
      * lisp/emacs-lisp/pcase.el (pcase): Doc fix.
      (pcase--split-vector): New function.
      (pcase--q1): Support vector qpattern.  (Bug#18327)
      e872d52c
  3. 03 Jan, 2014 1 commit
  4. 01 Jan, 2014 1 commit
  5. 04 Aug, 2013 1 commit
    • Stefan Monnier's avatar
      * lisp/subr.el (macrop): New function. · 671d5c16
      Stefan Monnier authored
      (text-clone--maintaining): New var.
      (text-clone--maintain): Rename from text-clone-maintain.  Use it
      instead of inhibit-modification-hooks.
      
      * lisp/emacs-lisp/nadvice.el (advice--normalize): For aliases to macros, use
      a proxy, so as handle autoloads and redefinitions of the target.
      (advice--defalias-fset, advice-remove): Use advice--symbol-function.
      
      * lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
      Remove bogus (arrayp . stringp) pair.  Add entries for `vectorp'.
      (pcase--mutually-exclusive-p): New function.
      (pcase--split-consp): Use it.
      (pcase--split-pred): Use it.  Optimize the case where `pat' is a qpat
      mutually exclusive with the current predicate.
      
      * test/automated/advice-tests.el (advice-tests-nadvice): Test removal
      before definition.
      (advice-tests-macroaliases): New test.
      
      * lisp/emacs-lisp/edebug.el (edebug-lookup-function): Remove function.
      (edebug-macrop): Remove.  Use `macrop' instead.
      * lisp/emacs-lisp/advice.el (ad-subr-p): Remove.  Use `subrp' instead.
      (ad-macro-p):
      * lisp/eshell/esh-cmd.el (eshell-macrop):
      * lisp/apropos.el (apropos-macrop): Remove.  Use `macrop' instead.
      671d5c16
  6. 24 Jul, 2013 1 commit
  7. 08 Jul, 2013 1 commit
  8. 08 Jan, 2013 1 commit
  9. 01 Jan, 2013 1 commit
  10. 28 Sep, 2012 1 commit
  11. 04 Sep, 2012 1 commit
    • Stefan Monnier's avatar
      Macro-expand interpreted code during load. · 972debf2
      Stefan Monnier authored
      * src/lread.c (readevalloop): Call internal-macroexpand-for-load to perform
      eager (load-time) macro-expansion.
      * src/lisp.mk (lisp): Add macroexp.
      * lisp/loadup.el: Load macroexp.  Remove hack.
      * lisp/emacs-lisp/macroexp.el (macroexp--eval-if-compile): New function.
      (macroexp--expand-all): Use it to get better warnings.
      (macroexp--backtrace, macroexp--trim-backtrace-frame)
      (internal-macroexpand-for-load): New functions.
      (macroexp--pending-eager-loads): New var.
      (emacs-startup-hook): New hack to replace one in loadup.el.
      * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-list*)
      (cl--compiler-macro-cXXr): Move to top, before they can be used.
      (cl-psetf): Simplify.
      (cl-defstruct): Add indent rule.
      972debf2
  12. 26 Jul, 2012 1 commit
    • Stefan Monnier's avatar
      Autoload more carefully from Lisp. Follow aliases for function properties. · 7abaf5cc
      Stefan Monnier authored
      * lisp/subr.el (autoloadp): New function.
      (symbol-file): Use it.
      (function-get): New function.
      * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
      autoload-do-load.
      * lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
      (lisp-indent-function):
      * lisp/emacs-lisp/gv.el (gv-get):
      * lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
      * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
      * lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
      Use function-get.
      * lisp/emacs-lisp/cl.el: Don't propagate function properties any more.
      
      * src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
      add argument, tune behavior, and adjust all callers.
      
      * lisp/speedbar.el (speedbar-add-localized-speedbar-support):
      * lisp/emacs-lisp/disass.el (disassemble-internal):
      * lisp/desktop.el (desktop-load-file):
      * lisp/help-fns.el (help-function-arglist, find-lisp-object-file-name)
      (describe-function-1):
      * lisp/emacs-lisp/find-func.el (find-function-noselect):
      * lisp/emacs-lisp/elp.el (elp-instrument-function):
      * lisp/emacs-lisp/advice.el (ad-has-proper-definition):
      * lisp/apropos.el (apropos-safe-documentation, apropos-macrop):
      * lisp/emacs-lisp/debug.el (debug-on-entry):
      * lisp/emacs-lisp/cl-macs.el (cl-compiler-macroexpand):
      * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
      * lisp/calc/calc.el (name): Use autoloadp & autoload-do-load.
      7abaf5cc
  13. 11 Jul, 2012 1 commit
    • Stefan Monnier's avatar
      More CL cleanups and reduction of use of cl.el. · a464a6c7
      Stefan Monnier authored
      * woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
      * vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
      * textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
      * strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
      * progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
      * play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
      * play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
      * net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
      * image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
      * eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
      * eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
      * eshell/em-cmpl.el, eshell/em-banner.el:
      * url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
      * url/url-future.el, url/url-dav.el, url/url-cookie.el:
      * calendar/parse-time.el, test/eshell.el: Use cl-lib.
      * wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
      * vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
      * textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
      * term/ns-win.el, term.el, shell.el, ps-samp.el:
      * progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
      * progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
      * play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
      * net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
      * net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
      * mail/mailheader.el, mail/feedmail.el:
      * url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
      * url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
      Dont use CL.
      * ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
      * eshell/esh-opt.el (eshell-eval-using-options): Quote code with
      `lambda' rather than with `quote'.
      (eshell-do-opt): Adjust accordingly.
      (eshell-process-option): Simplify.
      * eshell/esh-var.el:
      * eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
      * emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
      (pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
      to `pcase--dontcare'.
      * emacs-cl.el (labels): Mark obsolete.
      (cl--letf, letf): Move to cl-lib.
      (cl--letf*, letf*): Remove.
      * emacs-cl-lib.el (cl-nth-value): Use defalias.
      * emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
      (cl-progv): Rewrite.
      (cl--letf, cl-letf): Move from cl.el.
      (cl-letf*): New macro.
      * emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
      a464a6c7
  14. 10 Jul, 2012 1 commit
  15. 22 Jun, 2012 1 commit
    • Stefan Monnier's avatar
      Provide generalized variables in core Elisp. · 2ee3d7f0
      Stefan Monnier authored
      * lisp/emacs-lisp/gv.el: New file.
      * lisp/subr.el (push, pop): Extend to generalized variables.
      * lisp/loadup.el (macroexp): Unload if preloaded and uncompiled.
      * lisp/emacs-lisp/cl-lib.el (cl-pop, cl-push, cl--set-nthcdr): Remove.
      * lisp/emacs-lisp/cl-macs.el: Require gv.  Use gv-define-setter,
      gv-define-simple-setter, and gv-define-expander.
      Remove setf-methods defined in gv.  Rename cl-setf -> setf.
      (cl-setf, cl-do-pop, cl-get-setf-method): Remove.
      (cl-letf, cl-letf*, cl-define-modify-macro, cl-defsetf)
      (cl-define-setf-expander, cl-struct-setf-expander): Move to cl.el.
      (cl-remf, cl-shiftf, cl-rotatef, cl-callf, cl-callf2): Rewrite with
      gv-letplace.
      (cl-defstruct): Don't define setf-method any more.
      * lisp/emacs-lisp/cl.el (flet): Don't autoload.
      (cl--letf, letf, cl--letf*, letf*, cl--gv-adapt)
      (define-setf-expander, defsetf, define-modify-macro)
      (cl-struct-setf-expander): Move from cl-lib.el.
      * lisp/emacs-lisp/syntax.el:
      * lisp/emacs-lisp/ewoc.el:
      * lisp/emacs-lisp/smie.el:
      * lisp/emacs-lisp/cconv.el:
      * lisp/emacs-lisp/timer.el: Rename cl-setf -> setf, cl-push -> push.
      (timer--time): Use gv-define-simple-setter.
      * lisp/emacs-lisp/macroexp.el (macroexp-let2): Rename from macroexp-let²
      to avoid coding-system problems in subr.el.  Adjust all users.
      (macroexp--maxsize, macroexp-small-p): New functions.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't use cl-letf.
      * lisp/scroll-bar.el (scroll-bar-mode):
      * lisp/simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
      (normal-erase-is-backspace-mode): Don't use the `eq' place.
      * lisp/winner.el (winner-configuration, winner-make-point-alist)
      (winner-set-conf, winner-get-point, winner-set): Don't abuse letf.
      * lisp/files.el (locate-file-completion-table): Avoid list*.
      
      Fixes: debbugs:11657
      2ee3d7f0
  16. 18 Jun, 2012 1 commit
  17. 11 Jun, 2012 2 commits
  18. 08 Jun, 2012 1 commit
    • Stefan Monnier's avatar
      Clean up scoping rule of predefined single-word vars. · 513749ee
      Stefan Monnier authored
      * lisp/startup.el (argv, argi): Make lexically scoped.
      * lisp/emacs-lisp/float-sup.el (pi): Use internal-make-var-non-special.
      * lisp/emacs-lisp/cl-macs.el: Use lexical-binding.
      Rename cl-bind-* to cl--bind-*.
      * lisp/files.el: Don't require `cl' since it doesn't use it.
      * lisp/emacs-lisp/pcase.el, lisp/emacs-lisp/macroexp.el: Add coding cookie.
      * src/eval.c (Fmake_var_non_special): New primitive.
      (syms_of_eval): Defsubr it.
      * src/lread.c (syms_of_lread): Mark `values' as lexically scoped.
      513749ee
  19. 07 Jun, 2012 1 commit
    • Stefan Monnier's avatar
      Cleanup cl-macs namespace. Add macro helpers in macroexp.el. · 4dd1c416
      Stefan Monnier authored
      * emacs-lisp/macroexp.el (macroexp-progn, macroexp-let*, macroexp-if)
      (macroexp-let², macroexp--const-symbol-p, macroexp-const-p)
      (macroexp-copyable-p): New functions and macros.
      * emacs-lisp/edebug.el (edebug-unwrap):
      * emacs-lisp/disass.el (disassemble-internal): Use macroexp-progn.
      * emacs-lisp/pcase.el: Use macroexp-let*, macroexp-if, ...
      (pcase--let*): Remove.
      * emacs-lisp/bytecomp.el (byte-compile-const-symbol-p)
      (byte-compile-constp): Remove.  Use macroexp--const-symbol-p and
      macroexp-const-p instead.
      * emacs-lisp/byte-opt.el: Use macroexp-const-p and macroexp-progn.
      
      * emacs-lisp/cl-macs.el: Clean up the name space by using "cl--"
      instead of "cl-" for internal definitions.  Use macroexp-const-p.
      (cl-old-bc-file-form): Remove var.
      (cl-const-exprs-p): Remove fun.
      (cl-labels, cl-macrolet): Use backquote.
      (cl-lexical-let): Use cl-symbol-macrolet.  Don't use cl-defun-expander.
      (cl-defun-expander, cl-byte-compile-compiler-macro): Remove fun.
      (cl-define-setf-expander): Rename from cl-define-setf-method.
      * emacs-lisp/cl.el: Adjust alias for define-setf-method.
      
      * international/mule-cmds.el: Don't require CL.
      (view-hello-file): Don't use `letf'.
      4dd1c416
  20. 29 May, 2012 1 commit
    • Stefan Monnier's avatar
      Fix minor corner case bugs in byte compilation and pcase. · 6876a58d
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Don't re-preprocess
      functions from byte-compile-function-environment.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-constp): Treat #'v as a constant.
      (byte-compile-close-variables): Bind byte-compile--outbuffer here...
      (byte-compile-from-buffer): ...rather than here.
      * lisp/emacs-lisp/pcase.el (pcase--expand): Accept different sets of vars in
      different alternative patterns.
      (pcase-codegen): Be more careful to preserve identity.
      (pcase--u1): Don't forget to mark vars as used.
      6876a58d
  21. 26 May, 2012 1 commit
    • Stefan Monnier's avatar
      Use `declare' in `lambda' and mis minor changes. · a179e3f7
      Stefan Monnier authored
      * lisp/subr.el (lambda): Use declare.
      * lisp/emacs-lisp/lisp-mode.el (lambda):
      * lisp/emacs-lisp/edebug.el (lambda): Move properties to its definition.
      * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unhook-expire-days):
      * lisp/gnus/gnus-demon.el (gnus-demon-init): Don't bother with type-of.
      a179e3f7
  22. 17 May, 2012 1 commit
  23. 15 May, 2012 1 commit
  24. 05 May, 2012 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/pcase.el (pcase--let*): New function. · 5342bb06
      Stefan Monnier authored
      (pcase--expand, pcase-codegen, pcase--q1): Use it to reduce nesting
      a bit more.
      (pcase--split-pred): Be more clever about ruling out overlap between
      a predicate and some constant pattern.
      (pcase--q1): Use `null' instead of (eq foo nil).
      5342bb06
  25. 05 Jan, 2012 1 commit
  26. 31 Dec, 2011 1 commit
  27. 15 Dec, 2011 1 commit
  28. 16 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      Remove bytecomp- prefix, plus misc changes. · ca105506
      Stefan Monnier authored
      * 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.
      ca105506
  29. 06 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      Fix pcase memoizing; change lexbound byte-code marker. · e2abe5a1
      Stefan Monnier authored
      * 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.
      e2abe5a1
  30. 01 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      * doc/lispref/variables.texi (Scope): Mention the availability of lexbind. · d032d5e7
      Stefan Monnier authored
      (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.
      d032d5e7
  31. 28 Feb, 2011 1 commit
  32. 27 Feb, 2011 1 commit
  33. 18 Feb, 2011 2 commits
  34. 17 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      Various compiler bug-fixes. MPC seems to run correctly now. · b38b1ec0
      Stefan Monnier authored
      * 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.
      b38b1ec0
  35. 10 Feb, 2011 1 commit
    • Igor Kuzmin's avatar
      * lisp/emacs-lisp/cconv.el: New file. · 94d11cb5
      Igor Kuzmin authored
      * 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.
      94d11cb5
  36. 25 Jan, 2011 1 commit
  37. 15 Jan, 2011 1 commit
  38. 24 Nov, 2010 1 commit