1. 02 Apr, 2011 11 commits
  2. 01 Apr, 2011 7 commits
    • Juanma Barranquero's avatar
    • Juanma Barranquero's avatar
    • Stefan Monnier's avatar
      Merge from lexical-binding branch. · 03408648
      Stefan Monnier authored
      * doc/lispref/eval.texi (Eval): Discourage the use of `eval'.
      Document its new `lexical' argument.
      * doc/lispref/variables.texi (Defining Variables): Mention the new meaning of `defvar'.
      (Lexical Binding): New sub-section.
      New variables.
      (compile-onefile, .el.elc, compile-calc, recompile): Use them.
      (COMPILE_FIRST): Add macroexp and cconv.
      * lisp/makefile.w32-in: Mirror changes in Makefile.in.
      * lisp/vc/cvs-status.el:
      * lisp/vc/diff-mode.el:
      * lisp/vc/log-edit.el:
      * lisp/vc/log-view.el:
      * lisp/vc/smerge-mode.el:
      * lisp/textmodes/bibtex-style.el:
      * textmodes/css.el:
      * lisp/startup.el:
      * lisp/uniquify.el:
      * lisp/minibuffer.el: 
      * lisp/newcomment.el: 
      * lisp/reveal.el: 
      * lisp/server.el: 
      * lisp/mpc.el: 
      * lisp/emacs-lisp/smie.el: 
      * lisp/doc-view.el: 
      * lisp/dired.el: 
      * lisp/abbrev.el: Use lexical binding.
      * lisp/custom.el (custom-initialize-default, custom-declare-variable):
      Use `defvar'.
      * lisp/files.el (lexical-binding): Declare safe.
      * lisp/help-fns.el (help-split-fundoc): Return nil if there's nothing else
      than the arglist.
      (help-add-fundoc-usage): Don't add `Not documented'.
      (help-function-arglist): Handle closures, subroutines, and new
      (help-make-usage): Remove leading underscores.
      (describe-function-1): Handle closures.
      (describe-variable): Use special-variable-p for completion.
      * lisp/simple.el (with-wrapper-hook, apply-partially): Move to subr.el.
      * lisp/subr.el (apply-partially): Use new closures rather than CL.
      (--dolist-tail--, --dotimes-limit--): Don't declare dynamic.
      (dolist, dotimes): Use slightly different expansion for lexical code.
      (functionp): Move to C.
      (letrec): New macro.
      (with-wrapper-hook): Use it and apply-partially instead of CL.
      (eval-after-load): Preserve lexical-binding.
      (save-window-excursion, with-output-to-temp-buffer): Turn them
      into macros.
      * lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist.
      * lisp/emacs-lisp/autoload.el (make-autoload): Don't burp on trivial macros.
      * lisp/emacs-lisp/byte-opt.el: Use lexical binding.
      (byte-inline-lapcode): Remove (to bytecomp).
      (byte-compile-inline-expand): Pay attention to inlining to/from
      lexically bound code.
      (byte-compile-unfold-lambda): Don't handle byte-code-functions
      any more.
      (byte-optimize-form-code-walker): Don't handle save-window-excursion
      any more and don't call compiler-macros.
      (byte-compile-splice-in-already-compiled-code): Remove.
      (byte-code): Don't inline any more.
      (disassemble-offset): Receive `bytes' as argument rather than via
      dynamic scoping.
      (byte-compile-tag-number): Declare before first use.
      (byte-decompile-bytecode-1): Handle new byte-codes, don't change
      `return' even if make-spliceable.
      (byte-compile-side-effect-and-error-free-ops): Add stack-ref, remove
      obsolete interactive-p.
      (byte-optimize-lapcode): Optimize new lap-codes.
      Don't trip up on new form of `byte-constant' lap code.
      * lisp/emacs-lisp/byte-run.el (make-obsolete): Don't set the `byte-compile'
      handler any more.
      * lisp/emacs-lisp/bytecomp.el: Use lexical binding instead of
      a "bytecomp-" prefix.  Macroexpand everything as a separate phase.
      Handle declare-function here.
      (byte-compile--lexical-environment): New var.
      (byte-stack-ref, byte-stack-set, byte-discardN)
      (byte-discardN-preserve-tos): New lap codes.
      (byte-interactive-p): Don't use any more.
      (byte-compile-push-bytecodes, byte-compile-push-bytecode-const2):
      New macros.
      (byte-compile-lapcode): Use them and handle new lap codes.
      (byte-compile-obsolete): Remove.
      (byte-compile-arglist-signature): Handle new byte-code arg"lists".
      (byte-compile-arglist-warn): Check late def of inlinable funs.
      (byte-compile-cl-warn): Don't silence warnings for compiler-macros
      since they should have been expanded by now.
      (byte-compile--outbuffer): Rename from bytecomp-outbuffer.
      (byte-compile-from-buffer): Remove unused second arg.
      (byte-compile-preprocess): New function.
      (byte-compile-toplevel-file-form): New function to distinguish
      file-form calls from outside from file-form calls from hunk-handlers.
      (byte-compile-file-form): Simplify.
      (byte-compile-file-form-defsubst): Remove.
      (byte-compile-file-form-defmumble): Simplify now that
      byte-compile-lambda always returns a byte-code-function.
      (byte-compile): Preprocess.
      (byte-compile-byte-code-maker, byte-compile-byte-code-unmake):
      Remove, not used any more.
      (byte-compile-arglist-vars, byte-compile-make-lambda-lexenv)
      (byte-compile-make-args-desc): New funs.
      (byte-compile-lambda): Handle lexical functions.  Always return
      a byte-code-function.
      (byte-compile-reserved-constants): New var, to make up room for
      closed-over variables.
      (byte-compile-constants-vector): Obey it.
      (byte-compile-top-level): New args `lexenv' and `reserved-csts'.
      (byte-compile-macroexpand-declare-function): New function.
      (byte-compile-form): Call byte-compile-unfold-bcf to inline immediate
      (byte-compile-form): Check obsolescence here.
      (byte-compile-inline-lapcode, byte-compile-unfold-bcf): New functions.
      (byte-compile-variable-ref): Remove.
      (byte-compile-dynamic-variable-op): New fun.
      (byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
      (byte-compile-variable-set): New funs.
      (byte-compile-discard): Add 2 args.
      (byte-compile-stack-ref, byte-compile-stack-set)
      (byte-compile-make-closure, byte-compile-get-closed-var): New funs.
      (byte-compile-funarg, byte-compile-funarg-2): Remove, handled in
      macroexpand-all instead.
      (byte-compile-quote-form): Remove.
      (byte-compile-push-binding-init, byte-compile-not-lexical-var-p)
      (byte-compile-bind, byte-compile-unbind): New funs.
      (byte-compile-let): Handle let* and lexical binding.
      (byte-compile-let*): Remove.
      (byte-compile-catch, byte-compile-unwind-protect)
      (byte-compile-track-mouse, byte-compile-condition-case):
      Handle a new :fun-body form, used for lexical scoping.
      (byte-compile-with-output-to-temp-buffer): Remove.
      (byte-compile-defun): Simplify.
      (byte-compile-stack-adjustment): New fun.
      (byte-compile-out): Use it.
      (byte-compile-refresh-preloaded): Don't reload byte-compiler files.
      * lisp/emacs-lisp/cconv.el: New file.
      * lisp/emacs-lisp/cl-extra.el (cl-macroexpand-all): Properly quote CL
      * lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block)
      (cl-byte-compile-throw): Remove.
      (cl-block-wrapper, cl-block-throw): Use compiler-macros instead.
      * lisp/emacs-lisp/cl.el (pushnew): Silence warning.
      * lisp/emacs-lisp/disass.el (disassemble-internal): Handle new
      `closure' objects.
      (disassemble-1): Handle new byte codes.
      * lisp/emacs-lisp/edebug.el (edebug-eval-defun)
      (edebug-eval-top-level-form): Use eval-sexp-add-defvars.
      (edebug-toggle): Avoid `eval'.
      * lisp/emacs-lisp/eieio-comp.el: Remove.
      * lisp/emacs-lisp/eieio.el (byte-compile-file-form-defmethod):
      Don't autoload.
      (eieio-defgeneric-form-primary-only-one): Use `byte-compile' rather
      than the internal `byte-compile-lambda'.
      (defmethod): Don't hide code under quotes.
      (eieio-defmethod): New `code' argument.
      * lisp/emacs-lisp/float-sup.el (pi): Don't declare as dynamically bound.
      * lisp/emacs-lisp/lisp-mode.el (eval-last-sexp-1):
      Use eval-sexp-add-defvars.
      (eval-sexp-add-defvars): New fun.
      * lisp/emacs-lisp/macroexp.el: Use lexical binding.
      (macroexpand-all-1): Check obsolete macros.  Expand compiler-macros.
      Don't convert ' to #' without checking that it's indeed quoting
      a lambda.
      * lisp/emacs-lisp/pcase.el: Don't use destructuring-bind.
      (pcase--memoize): Rename from pcase-memoize.  Change weakness.
      (pcase): Add `let' pattern.
      Change memoization so it actually works.
      (pcase-mutually-exclusive-predicates): Add byte-code-function-p.
      (pcase--u1) <guard, pred>: Fix possible shadowing problem.
      <let>: New case.
      * src/alloc.c (Fmake_symbol): Init new `declared_special' field.
      * src/buffer.c (defvar_per_buffer): Set new `declared_special' field.
      * src/bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
      New byte-codes.
      (exec_byte_code): New function extracted from Fbyte_code to handle new
      calling convention for byte-code-functions.  Add new byte-codes.
      * src/callint.c (Fcall_interactively): Preserve lexical-binding mode for
      interactive spec.
      * src/doc.c (Fdocumentation, store_function_docstring):
      * src/data.c (Finteractive_form): Handle closures.
      * src/eval.c (Fsetq): Handle lexical vars.
      (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
      (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
      (FletX, Flet): Obey lexical binding.
      (Fcommandp): Handle closures.
      (Feval): New `lexical' arg.
      (eval_sub): New function extracted from Feval.  Use it almost
      everywhere where Feval was used.  Look up vars in lexical env.
      Handle closures.
      (Ffunctionp): Move from subr.el.
      (Ffuncall): Handle closures.
      (apply_lambda): Remove `eval_flags'.
      (funcall_lambda): Handle closures and new byte-code-functions.
      (Fspecial_variable_p): New function.
      (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
      but without exporting it to Lisp.
      * src/fns.c (concat, mapcar1): Accept byte-code-functions.
      * src/image.c (parse_image_spec): Use Ffunctionp.
      * src/keyboard.c (eval_dyn): New fun.
      (menu_item_eval_property): Use it.
      * src/lisp.h (struct Lisp_Symbol): New field `declared_special'.
      * src/lread.c (lisp_file_lexically_bound_p): New function.
      (Fload): Bind Qlexical_binding.
      (readevalloop): Remove `evalfun' arg.
      Bind Qinternal_interpreter_environment.
      (Feval_buffer): Bind Qlexical_binding.
      (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
      Mark as dynamic.
      (syms_of_lread): Declare `lexical-binding'.
      * src/window.c (Ftemp_output_buffer_show): New fun.
      * src/print.c (Fwith_output_to_temp_buffer): Move to subr.el.
    • 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.
    • Julien Danjou's avatar
    • Eli Zaretskii's avatar
      Add a new command `info-display-manual'. · 0f0c1f27
      Eli Zaretskii authored
       lisp/info.el (info-display-manual): New function.
    • Paul Eggert's avatar
  3. 31 Mar, 2011 10 commits
  4. 30 Mar, 2011 12 commits
    • Christoph Scholtes's avatar
      * progmodes/python.el (python-default-interpreter) · 6d0f1c9e
      Christoph Scholtes authored
      (python-python-command-args, python-jython-command-args)
      (python-which-shell, python-which-args, python-which-bufname)
      (python-file-queue, python-comint-output-filter-function)
      (python-toggle-shells, python-shell): Remove obsolete defcustoms,
      variables and functions.
    • Stefan Monnier's avatar
      (completion-in-region): Pop down *Completions* automatically. · 3e2d70fd
      Stefan Monnier authored
      * lisp/minibuffer.el (completion-table-dynamic): Optimize `boundaries'.
      (completion-in-region-mode): New minor mode.
      (completion-in-region): Use it.
      (completion-in-region--data, completion-in-region-mode-map): New vars.
      (completion-in-region--postch): New function.
      (completion--capf-misbehave-funs, completion--capf-safe-funs): New vars.
      (completion--capf-wrapper): New function.
      (completion-at-point): Use it to track well-behavedness of hook functions.
      (completion-help-at-point): New command.
    • Jason Merrill's avatar
      * lisp/vc/add-log.el (add-change-log-entry): Don't use whitespace · f3e4086c
      Jason Merrill authored
      syntax class to search for whitespace on a single line
      (Message-ID: <4D938140.4030905@redhat.com>).
    • Eli Zaretskii's avatar
      Documentation parts of the scroll fix. · 09725d26
      Eli Zaretskii authored
       src/xdisp.c (syms_of_xdisp) <scroll-conservatively>: Document the
       threshold of 100 lines for never-recentering scrolling.
       doc/emacs/display.texi (Auto Scrolling): Document the limit of 100
       lines for never-recentering scrolling with `scroll-conservatively'.
    • Stefan Monnier's avatar
      * src/eval.c (struct backtrace): Don't cheat with negative numbers, but do · 44f230aa
      Stefan Monnier authored
      steal a few bits to be more compact.
      (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
      Remove unneeded casts.
    • Stefan Monnier's avatar
      * lisp/subr.el (apply-partially): Use a non-nil static environment. · f488fb65
      Stefan Monnier authored
      (--dolist-tail--, --dotimes-limit--): Don't declare dynamically bound.
      (dolist): Use a more efficient form for lexical-binding.
      (dotimes): Use a cleaner semantics for lexical-binding.
      * lisp/emacs-lisp/edebug.el (edebug-eval-top-level-form):
      Use eval-sexp-add-defvars.
    • Stefan Monnier's avatar
    • Gnus developers's avatar
      Merge Gnus' changes. · a5954fa5
      Gnus developers authored
      gnus.texi (Listing Groups): Document gnus-group-list-ticked.
      gssapi.el (open-gssapi-stream): Remove the last mentions of the IMAP stuff.
      gnus-score.el (gnus-score-string): Fix calling convention of `gnus-simplify-buffer-fuzzy' after last patches.
      gnus-sum.el (gnus-update-marks): Don't send any marks updates to the server for articles we didn't get any headers for.  This is a sanity check.
      nnimap.el (nnimap-open-connection-1): Is the login responds with a new CAPABILITY, use it.
      gnus-agent.el (gnus-agent-fetch-headers): Don't message if we're not downloading anything.
      gnus.el (gnus-splash-svg-color-symbols): Removed superfluous `and'.
      gnus.el (gnus-group-startup-message): Prefer svg file and replace colors.
       (gnus-splash-svg-color-symbols): New function.
      gnus-sum.el (gnus-simplify-buffer-fuzzy): Take the regexp explicitly instead of using the global gnus-simplify-subject-fuzzy-regexp.
       (gnus-simplify-subject-fuzzy): Use the local gnus-simplify-subject-fuzzy-regex instead of the global one.  This makes using this variable in group parameters work.
      gnus-registry.el (gnus-registry-unfollowed-groups): Add "archive:sent" to the unfollowed group regex (for the recent Gnus archive:sent-YYYY-MM-DD groups).
       (gnus-registry-split-fancy-with-parent): Bail out early in sender tracking if there are more than `gnus-registry-max-track-groups' matches.
      message.el (message--yank-original-internal): New function to do the insertion cleanly inside eval in `message-yank-original'.
       (message-yank-original): Use it.
    • Juanma Barranquero's avatar
    • Zachary Kanfer's avatar
      * src/keyboard.c (Fexecute_extended_command): Do log the "suggest key · 888adce9
      Zachary Kanfer authored
      binding" message.
      Fixes: debbugs:7967
    • Stefan Monnier's avatar
      * lisp/subr.el (with-output-to-temp-buffer): Don't change current-buffer to · 9dba2c64
      Stefan Monnier authored
      standard-output while running the body.
      * lisp/Makefile.in (COMPILE_FIRST): Remove pcase; it's not so important.
      * lisp/startup.el: Fix up warnings, move lambda expressions
      outside of quote.
    • Chong Yidong's avatar
      Change default type of open-protocol-stream. · e742e117
      Chong Yidong authored
      * nnimap.el (nnimap-stream, nnimap-open-connection-1): Accept `network'
      * nntp.el (nntp-open-connection-function): Document the fact that some
      values are not functions but are instead handled specially.  Recognize
      nntp-open-plain-stream value.
      (nntp-open-connection): Recognize that value.
      * proto-stream.el (open-protocol-stream): Bring back `network' type.
      Make this the default type.
      (proto-stream-open-plain): Rename from proto-stream-open-default.
      (open-protocol-stream, proto-stream-open-starttls)
      (proto-stream-open-tls, proto-stream-open-shell): Replace `default'
      with `plain'.