1. 20 Nov, 2011 2 commits
  2. 17 Nov, 2011 1 commit
  3. 10 Nov, 2011 1 commit
    • Glenn Morris's avatar
      toggle-read-only fixes for bugs#7292, 10006. · b2621720
      Glenn Morris authored
      * doc/lispref/buffers.texi (Read Only Buffers): Expand a bit on why
      toggle-read-only should only be used interactively.
      
      * lisp/files.el (toggle-read-only): Mention that it should only
      be used interactively.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
      Add toggle-read-only.
      b2621720
  4. 17 Sep, 2011 1 commit
  5. 13 Jul, 2011 1 commit
    • Chong Yidong's avatar
      Add FORCE-SAME-WINDOW argument to switch-to-buffer. · bee0fcef
      Chong Yidong authored
      * lisp/window.el (switch-to-buffer): New arg FORCE-SAME-WINDOW.  Use
      pop-to-buffer buffer-or-name if it is nil.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
      Remove switch-to-buffer.
      bee0fcef
  6. 04 Jul, 2011 1 commit
  7. 21 Jun, 2011 1 commit
  8. 01 Jun, 2011 2 commits
    • Stefan Monnier's avatar
      Silence various byte-compiler warnings. · 2403c841
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-run.el (make-obsolete-variable): New argument
      `access-type' and new obsolescence format.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Adjust to
      new format.
      (byte-compile-check-variable): New `access-type' argument.
      Only warn if the access-type is obsolete.
      (byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
      (byte-compile-variable-set): Adjust callers.
      * lisp/help-fns.el (describe-variable): Adjust to new obsolescence format.
      * lisp/mail/sendmail.el (mail-mailer-swallows-blank-line): Only mark
      setting it as obsolete.
      * lisp/simple.el (minibuffer-completing-symbol):
      * lisp/font-lock.el (font-lock-beginning-of-syntax-function): Only mark read
      access as obsolete.
      * lisp/minibuffer.el (minibuffer-completing-file-name): Don't make it
      obsolete yet.
      * lisp/international/quail.el (quail-mouse-choose-completion): Remove unused
      code referring to obsolete var.
      (quail-choose-completion-string): Remove.
      * lisp/server.el (server-clients-with, server-kill-buffer-query-function)
      (server-kill-emacs-query-function): Silence "unused `proc'" warnings.
      * lisp/proced.el (proced-send-signal):
      * lisp/emacs-lisp/lisp.el (lisp-complete-symbol):
      Replace completion-annotate-function with completion-extra-properties.
      2403c841
    • Stefan Monnier's avatar
      Miscellaneous tweaks. · 2462470b
      Stefan Monnier authored
      * lisp/emacs-lisp/cl-macs.el (dolist, dotimes): Use the same strategy for
      lexical scoping as in subr.el's dolist and dotimes.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
      Silence compiler warning.
      * lisp/thingatpt.el (forward-whitespace): Trivial coding style fix.
      * lisp/subr.el (with-output-to-temp-buffer): Provide an edebug spec.
      * lisp/international/ccl.el (ccl-compile): Trivial simplification.
      * lisp/help-fns.el (help-do-arg-highlight): Silence compiler warning.
      * lisp/emacs-lisp/testcover.el (testcover-end): Remove spurious
      `printflag' argument.
      * lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
      Purecopy the whole obsolescence data.
      2462470b
  9. 30 May, 2011 1 commit
  10. 23 May, 2011 1 commit
  11. 22 May, 2011 1 commit
  12. 12 May, 2011 1 commit
    • Glenn Morris's avatar
      bytecomp.el fix for bug#8647 · d45885f7
      Glenn Morris authored
      * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
      Let byte-compile-initial-macro-environment always take precedence.
      d45885f7
  13. 11 May, 2011 2 commits
  14. 07 May, 2011 1 commit
  15. 15 Apr, 2011 1 commit
  16. 01 Apr, 2011 1 commit
    • Stefan Monnier's avatar
      Miscellanous cleanups in preparation for the merge. · 7200d79c
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      Remove debug statement.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-single-version)
      (byte-compile-version-cond, byte-compile-delay-out)
      (byte-compile-delayed-out): Remove, unused.
      * src/bytecode.c (Fbyte_code): Revert to old calling convention.
      * src/lisp.h (COMPILED_PUSH_ARGS): Remove, unused.
      7200d79c
  17. 23 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      Clean up left over Emacs-18/19 code, inline byte-code-functions. · 29a4dcb0
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-opt.el (byte-inline-lapcode): Move to bytecomp.el.
      (byte-compile-inline-expand): Inline all bytecompiled functions.
      Unify the inlining code of the lexbind and dynbind interpreted functions.
      (byte-compile-unfold-lambda): Don't handle byte-compiled functions at all.
      (byte-optimize-form-code-walker): Don't optimize byte-compiled inlined
      functions here.
      (byte-compile-splice-in-already-compiled-code): Remove.
      (byte-code): Don't optimize it any more.
      (byte-decompile-bytecode-1): Remove unused bytedecomp-bytes.
      Leave `byte-return's even for `make-spliceable'.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
      byte-compile-lambda now always returns a byte-code-function.
      (byte-compile-byte-code-maker, byte-compile-byte-code-unmake)
      (byte-compile-closure): Remove.
      (byte-compile-lambda): Always return a byte-code-function.
      (byte-compile-top-level): Don't handle `byte-code' forms specially.
      (byte-compile-inline-lapcode): New function, taken from byte-opt.el.
      (byte-compile-unfold-bcf): New function.
      (byte-compile-form): Use it to optimize inline byte-code-functions.
      (byte-compile-function-form, byte-compile-defun): Simplify.
      (byte-compile-defmacro): Don't bother calling
      byte-compile-byte-code-maker.
      29a4dcb0
  18. 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
  19. 15 Mar, 2011 1 commit
  20. 13 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      * src/eval.c (Ffunction): Use simpler format for closures. · 23aba0ea
      Stefan Monnier authored
      (Fcommandp, funcall_lambda):
      * src/doc.c (Fdocumentation, store_function_docstring):
      * src/data.c (Finteractive_form):
      * lisp/help-fns.el (help-function-arglist):
      * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
      * lisp/subr.el (apply-partially): Adjust to new closure format.
      * lisp/emacs-lisp/disass.el (disassemble-internal): Catch closures.
      23aba0ea
  21. 12 Mar, 2011 2 commits
    • Stefan Monnier's avatar
      Try and fix w32 build; misc cleanup. · 2ec42da9
      Stefan Monnier authored
      * lisp/subr.el (apply-partially): Move from subr.el; don't use lexical-let.
      (eval-after-load): Obey lexical-binding.
      * lisp/simple.el (apply-partially): Move to subr.el.
      * lisp/makefile.w32-in: Match changes in Makefile.in.
      (BIG_STACK_DEPTH, BIG_STACK_OPTS, BYTE_COMPILE_FLAGS): New vars.
      (.el.elc, compile-CMD, compile-SH, compile-always-CMD)
      (compile-always-SH, compile-calc-CMD, compile-calc-SH): Use them.
      (COMPILE_FIRST): Add pcase, macroexp, and cconv.
      * lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Silence warning about
      calling CL's `compiler-macroexpand'.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): New function.
      (byte-compile-initial-macro-environment)
      (byte-compile-toplevel-file-form, byte-compile, byte-compile-sexp): Use it.
      (byte-compile-eval, byte-compile-eval-before-compile): Obey lexical-binding.
      (byte-compile--for-effect): Rename from `for-effect'.
      (display-call-tree): Use case.
      * lisp/emacs-lisp/byte-opt.el (for-effect): Don't declare as dynamic.
      (byte-optimize-form-code-walker, byte-optimize-form):
      Revert to old arg name.
      * lisp/Makefile.in (BYTE_COMPILE_FLAGS): New var.
      (compile-onefile, .el.elc, compile-calc, recompile): Use it.
      2ec42da9
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable): · 3aaaa6f1
      Stefan Monnier authored
      Disable obsolescence warnings in the file that declares it.
      3aaaa6f1
  22. 11 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      Misc fixes, and use lexical-binding in more files. · ba83908c
      Stefan Monnier authored
      * lisp/subr.el (letrec): New macro.
      (with-wrapper-hook): Move from lisp/simple.el and don't use CL.
      * simple.el (with-wrapper-hook): Move with-wrapper-hook to subr.el.
      * lisp/help-fns.el (help-function-arglist): Handle subroutines as well.
      (describe-variable): Use special-variable-p to filter completions.
      * lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Don't expand `declare'
      in defmacros.
      * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form):
      Handle `declare'.
      * lisp/emacs-lisp/cl.el (pushnew): Silence unfixable warning.
      * lisp/emacs-lisp/cl-macs.el (defstruct, define-compiler-macro):
      Mark unused arg as unused.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Use memq.
      * lisp/emacs-lisp/autoload.el (make-autoload): Don't assume the macro's
      first sexp is a list.
      (autoload-generate-file-autoloads): Improve error message.
      * lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist
      to understand the new byte-code arg format.
      * lisp/vc/smerge-mode.el:
      * lisp/vc/log-view.el:
      * lisp/vc/log-edit.el:
      * lisp/vc/cvs-status.el:
      * lisp/uniquify.el:
      * lisp/textmodes/css-mode.el:
      * lisp/textmodes/bibtex-style.el:
      * lisp/reveal.el:
      * lisp/newcomment.el:
      * lisp/emacs-lisp/smie.el:
      * lisp/abbrev.el: Use lexical-binding.
      * src/eval.c (Fprog1, Fprog2): Simplify and use XCDR/XCAR.
      (Fdefvar): Remove redundant SYMBOLP check.
      (Ffunctionp): Don't signal an error for undefined aliases.
      * doc/lispref/variables.texi (Converting to Lexical Binding): New node.
      ba83908c
  23. 10 Mar, 2011 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/bytecomp.el: Use lexical-binding. · 9ace101c
      Stefan Monnier authored
      (byte-recompile-directory): Remove unused var `bytecomp-dest'.
      (byte-recompile-file): Use derived-mode-p.
      (byte-compile-from-buffer): Remove arg `bytecomp-filename'.
      Use byte-compile-current-file instead.
      (byte-compile-file): Adjust call accordingly.
      (bytecomp-outbuffer): Move declaration before first use.
      (for-effect): Declare dynamic.
      (byte-compile-file-form-defmumble): Use byte-compile-current-file.
      (byte-compile-top-level, byte-compile-out-toplevel, byte-compile-form):
      Move dyn-binding of for-effect from function argument to let binding.
      (byte-compile-out-toplevel): Don't both passing for-effect to
      byte-optimize-lapcode.
      (byte-compile-top-level-body, byte-compile-body):
      Rename for-effect -> for-effect-arg so it's lexical.
      * lisp/subr.el (functionp): Remove, now that it's in src/eval.c.
      9ace101c
  24. 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
  25. 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
  26. 26 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      Compute freevars in cconv-analyse. · a9de04fa
      Stefan Monnier authored
      * lisp/emacs-lisp/cconv.el: Compute freevars in cconv-analyse.
      (cconv-mutated, cconv-captured): Remove.
      (cconv-captured+mutated, cconv-lambda-candidates): Don't give them
      a global value.
      (cconv-freevars-alist): New var.
      (cconv-freevars): Remove.
      (cconv--lookup-let): Remove.
      (cconv-closure-convert-function): Extract from cconv-closure-convert-rec.
      (cconv-closure-convert-rec): Adjust to above changes.
      (fboundp): New function.
      (cconv-analyse-function, form): Rewrite.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
      Handle declare-function here.
      (byte-compile-obsolete): Remove.
      (byte-compile-arglist-warn): Check late defsubst here.
      (byte-compile-file-form): Simplify.
      (byte-compile-file-form-defsubst): Remove.
      (byte-compile-macroexpand-declare-function): Rename from
      byte-compile-declare-function, turn it into a macro-expander.
      (byte-compile-normal-call): Check obsolescence.
      (byte-compile-quote-form): Remove.
      (byte-compile-defmacro): Revert to trunk's definition which seems to
      work just as well and handles `declare'.
      * lisp/emacs-lisp/byte-run.el (make-obsolete): Don't modify byte-compile.
      * lisp/Makefile.in (BIG_STACK_DEPTH): Increase to 1200.
      (compile-onefile): Pass $(BIG_STACK_OPTS) before "-l bytecomp".
      * lisp/emacs-lisp/macroexp.el: Use lexbind.
      (macroexpand-all-1): Check macro obsolescence.
      * lisp/vc/diff-mode.el: Use lexbind.
      * lisp/follow.el (follow-calc-win-end): Simplify.
      a9de04fa
  27. 25 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      Get rid of funvec. · 876c194c
      Stefan Monnier authored
      * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Handle new form of
      `byte-constant'.
      (byte-compile-close-variables, displaying-byte-compile-warnings):
      Add edebug spec.
      (byte-compile-toplevel-file-form): New fun, split out of
      byte-compile-file-form.
      (byte-compile-from-buffer): Use it to avoid applying cconv
      multiple times.
      (byte-compile): Only strip `function' if it's present.
      (byte-compile-lambda): Add `reserved-csts' argument.
      Use new lexenv arg of byte-compile-top-level.
      (byte-compile-reserved-constants): New var.
      (byte-compile-constants-vector): Obey it.
      (byte-compile-constants-vector): Handle new `byte-constant' form.
      (byte-compile-top-level): Add args `lexenv' and `reserved-csts'.
      (byte-compile-form): Don't check callargs here.
      (byte-compile-normal-call): Do it here instead.
      (byte-compile-push-unknown-constant)
      (byte-compile-resolve-unknown-constant): Remove, unused.
      (byte-compile-make-closure): Use `make-byte-code' rather than `curry',
      putting the environment into the "constant" pool.
      (byte-compile-get-closed-var): Use special byte-constant.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Handle new
      intermediate special form `internal-make-vector'.
      (byte-optimize-lapcode): Handle new form of `byte-constant'.
      * lisp/help-fns.el (describe-function-1): Don't handle funvecs.
      * lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Only convert quote to
      function if the content is a lambda expression, not if it's a closure.
      * emacs-lisp/eieio-come.el: Remove.
      * lisp/emacs-lisp/eieio.el: Don't require eieio-comp.
      (defmethod): Do a bit more work to find the body and wrap it into
      a function before passing it to eieio-defmethod.
      (eieio-defmethod): New arg `code' for it.
      * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Don't hide things in
      debugger backtrace.
      * lisp/emacs-lisp/cl-extra.el (cl-macroexpand-all): Use backquotes, and be
      more careful when quoting a function value.
      * lisp/emacs-lisp/cconv.el (cconv-freevars): Accept defvar/defconst.
      (cconv-closure-convert-rec): Catch stray `internal-make-closure'.
      * lisp/Makefile.in (COMPILE_FIRST): Compile pcase and cconv early.
      
      * src/eval.c (Qcurry): Remove.
      (funcall_funvec): Remove.
      (funcall_lambda): Move new byte-code handling to reduce impact.
      Treat all args as lexical in the case of lexbind.
      (Fcurry): Remove.
      * src/data.c (Qfunction_vector): Remove.
      (Ffunvecp): Remove.
      * src/lread.c (read1): Revert to calling make_byte_code here.
      (read_vector): Don't call make_byte_code any more.
      * src/lisp.h (enum pvec_type): Rename back to PVEC_COMPILED.
      (XSETCOMPILED): Rename back from XSETFUNVEC.
      (FUNVEC_SIZE): Remove.
      (FUNVEC_COMPILED_TAG_P, FUNVEC_COMPILED_P): Remove.
      (COMPILEDP): Rename back from FUNVECP.
      * src/fns.c (Felt): Remove unexplained FUNVEC check.
      * src/doc.c (Fdocumentation): Don't handle funvec.
      * src/alloc.c (make_funvec, Ffunvec): Remove.
      * doc/lispref/vol2.texi (Top):
      * doc/lispref/vol1.texi (Top):
      * doc/lispref/objects.texi (Programming Types, Funvec Type, Type Predicates):
      * doc/lispref/functions.texi (Functions, What Is a Function, FunctionCurrying):
      * doc/lispref/elisp.texi (Top): Remove mentions of funvec and curry.
      876c194c
  28. 23 Feb, 2011 1 commit
  29. 21 Feb, 2011 2 commits
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/cconv.el (cconv-closure-convert-rec): Let the byte · cb9336bd
      Stefan Monnier authored
      compiler choose the representation of closures.
      (cconv--env-var): Remove.
      * lisp/emacs-lisp/bytecomp.el (byte-compile--env-var): New var.
      (byte-compile-make-closure, byte-compile-get-closed-var):
      New functions.
      * lisp/cedet/semantic/wisent/comp.el (wisent-byte-compile-grammar):
      Macroexpand before passing to byte-compile-form.
      cb9336bd
    • Stefan Monnier's avatar
      Use offsets relative to top rather than bottom for stack refs · 3e21b6a7
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-and-error-free-ops):
      Remove interactive-p.
      (byte-optimize-lapcode): Update optimizations now that stack-refs are
      relative to the top rather than to the bottom.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
      Turn stack-ref-0 into dup.
      (byte-compile-form): Don't indirect-function since it can signal
      errors.
      (byte-compile-stack-ref, byte-compile-stack-set): Adjust to stack-refs
      being relative to top rather than to bottom in the byte-code.
      (with-output-to-temp-buffer): Remove.
      (byte-compile-with-output-to-temp-buffer): Remove.
      * lisp/emacs-lisp/cconv.el: Use lexical-binding.
      (cconv--lookup-let): Rename from cconv-lookup-let.
      (cconv-closure-convert-rec): Fix handling of captured+mutated
      arguments in defun/defmacro.
      * lisp/emacs-lisp/eieio-comp.el (eieio-byte-compile-file-form-defmethod):
      Rename from byte-compile-file-form-defmethod.
      Don't byte-compile-lambda.
      (eieio-byte-compile-defmethod-param-convert): Rename from
      byte-compile-defmethod-param-convert.
      * lisp/emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one):
      Call byte-compile rather than byte-compile-lambda.
      * src/alloc.c (Fgarbage_collect): Don't mark the byte-stack redundantly.
      * src/bytecode.c (exec_byte_code): Change stack_ref and stack_set to use
      offsets relative to top rather than to bottom.
      * lisp/subr.el (with-output-to-temp-buffer): New macro.
      * lisp/simple.el (count-words-region): Don't use interactive-p.
      3e21b6a7
  30. 19 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      * lisp/subr.el (save-window-excursion): New macro, moved from C. · e0f57e65
      Stefan Monnier authored
      * lisp/emacs-lisp/lisp-mode.el (save-window-excursion): Don't touch.
      * lisp/emacs-lisp/cconv.el (cconv-closure-convert-rec, cconv-analyse-form):
      Don't handle save-window-excursion any more.
      * lisp/emacs-lisp/bytecomp.el (interactive-p, save-window-excursion):
      Don't use the byte-code any more.
      (byte-compile-form): Check macro expansion was done.
      (byte-compile-save-window-excursion): Remove.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      Ignore save-window-excursion.  Don't macroepand any more.
      
      * src/window.c (Fsave_window_excursion): Remove.  Moved to Lisp.
      (syms_of_window): Don't defsubr it.
      * src/window.h (Fsave_window_excursion): Don't declare it.
      * src/bytecode.c (exec_byte_code): Inline Fsave_window_excursion.
      e0f57e65
  31. 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
  32. 12 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/byte-lexbind.el: Delete. · ce5b520a
      Stefan Monnier authored
      * lisp/emacs-lisp/bytecomp.el (byte-compile-current-heap-environment)
      (byte-compile-current-num-closures): Remove vars.
      (byte-vec-ref, byte-vec-set): Remove byte codes.
      (byte-compile-arglist-vars, byte-compile-make-lambda-lexenv): Move from
      byte-lexbind.el.
      (byte-compile-lambda): Never build a closure.
      (byte-compile-closure-code-p, byte-compile-make-closure): Remove.
      (byte-compile-closure): Simplify.
      (byte-compile-top-level): Don't mess with heap environments.
      (byte-compile-dynamic-variable-bind): Always maintain
      byte-compile-bound-variables.
      (byte-compile-variable-ref, byte-compile-variable-set): Always just use
      the stack for lexical vars.
      (byte-compile-push-binding-init): Simplify.
      (byte-compile-not-lexical-var-p): New function, moved from cconv.el.
      (byte-compile-bind, byte-compile-unbind): New functions, moved and
      simplified from byte-lexbind.el.
      (byte-compile-let, byte-compile-let*): Simplify.
      (byte-compile-condition-case): Don't add :fun-body to the bound vars.
      (byte-compile-defmacro): Simplify.
      * lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops)
      (byte-optimize-lapcode): Remove byte-vec-ref and byte-vec-set.
      * lisp/emacs-lisp/cconv.el (cconv-not-lexical-var-p): Remove.
      (cconv-freevars, cconv-analyse-function, cconv-analyse-form):
      Use byte-compile-not-lexical-var-p instead.
      * src/bytecode.c (Bvec_ref, Bvec_set): Remove.
      (exec_byte_code): Don't handle them.
      * lisp/help-fns.el (describe-function-1): Fix paren typo.
      ce5b520a
  33. 11 Feb, 2011 2 commits
    • Stefan Monnier's avatar
      Let cconv use :fun-body in special forms that need it. · 295fb2ac
      Stefan Monnier authored
      * lisp/emacs-lisp/cconv.el (cconv-closure-convert): Drop `toplevel' arg.
      (cconv-closure-convert-toplevel): Remove.
      (cconv-lookup-let): New fun.
      (cconv-closure-convert-rec): Don't bother with defs-are-legal.
      Use :fun-body to handle special forms that require closing their forms.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form, byte-compile):
      Use cconv-closure-convert instead of cconv-closure-convert-toplevel.
      (byte-compile-lambda, byte-compile-make-closure):
      * lisp/emacs-lisp/byte-lexbind.el (byte-compile-maybe-push-heap-environment):
      Make sure cconv did its job.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Check stack-depth
      before using it.
      * lisp/dired.el (dired-desktop-buffer-misc-data): Don't use a dynamic var as
      function argument.
      295fb2ac
    • Stefan Monnier's avatar
      Make cconv-analyse understand the need for closures. · 43e67019
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
      Understand the :fun-body case for catch, save-window-excursion, and
      condition-case.
      (byte-compile-maybe-push-heap-environment): No need when nclosures is
      zero and byte-compile-current-num-closures is -1.
      
      * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Fix `fun' that was not
      renamed to `bytecomp-fun'.
      
      * lisp/emacs-lisp/cconv.el (cconv-not-lexical-var-p): New function.
      (cconv-freevars): Use it.
      (cconv-closure-convert-rec): Avoid `position'.
      (cconv-analyse-function): New function.
      (cconv-analyse-form): Use it.  `inclosure' can't be nil any more.
      Check lexical vars at let-binding time rather than when referenced.
      For defuns to be in an empty environment and lambdas to take lexical args.
      Pay attention to the need to build closures in catch, unwind-protect,
      save-window-excursion, condition-case, and track-mouse.
      Fix defconst/defvar handling.
      43e67019
  34. 10 Feb, 2011 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/bytecomp.el (byte-compile-catch) · d779e73c
      Stefan Monnier authored
      (byte-compile-unwind-protect, byte-compile-track-mouse)
      (byte-compile-condition-case, byte-compile-save-window-excursion):
      Provide a :fun-body alternative, so that info can be propagated from the
      surrounding context, as is the case for lexical scoping.
      
      * lisp/emacs-lisp/cconv.el (cconv-mutated, cconv-captured)
      (cconv-captured+mutated, cconv-lambda-candidates): Fix up declaration.
      (cconv-freevars): Minor cleanup.  Fix handling of the error var in
      condition-case.
      d779e73c