1. 02 Jan, 2013 1 commit
  2. 20 Nov, 2012 1 commit
    • Stefan Monnier's avatar
      Make called-interactively-p work for edebug or advised code. · 23ba2705
      Stefan Monnier authored
      * lisp/subr.el (called-interactively-p-functions): New var.
      (internal--called-interactively-p--get-frame): New macro.
      (called-interactively-p, interactive-p): Rewrite in Lisp.
      * lisp/emacs-lisp/nadvice.el (advice--called-interactively-skip): New fun.
      (called-interactively-p-functions): Use it.
      * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): New fun.
      (called-interactively-p-functions): Use it.
      * lisp/allout.el (allout-called-interactively-p): Don't assume
      called-interactively-p is a subr.
      * src/eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
      (syms_of_eval): Remove corresponding defsubr.
      * src/bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
      * test/automated/advice-tests.el (advice-tests--data): Remove.
      (advice-tests): Move the tests directly here instead.
      Add called-interactively-p tests.
      23ba2705
  3. 16 Nov, 2012 1 commit
  4. 13 Nov, 2012 2 commits
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/advice.el: Layer on top of nadvice.el. · 3c442f8b
      Stefan Monnier authored
      Remove out of date self-require hack.
      (ad-do-advised-functions): Use simple `dolist'.
      (ad-advice-name, ad-advice-protected, ad-advice-enabled)
      (ad-advice-definition): Redefine as functions.
      (ad-advice-classes): Move before first use.
      (ad-make-origname, ad-set-orig-definition, ad-clear-orig-definition)
      (ad-make-mapped-call, ad-make-advised-docstring, ad-make-plain-docstring)
      (ad--defalias-fset): Remove functions.
      (ad-make-advicefunname, ad-clear-advicefunname-definition): New functions.
      (ad-get-orig-definition): Rewrite.
      (ad-make-advised-definition-docstring): Change base docstring.
      (ad-real-orig-definition): Rewrite.
      (ad-map-arglists): Change name of called function.
      (ad--make-advised-docstring): Redirect `function' from ad-Advice-...
      (ad-make-advised-definition): Simplify.
      (ad-assemble-advised-definition): Tweak for new calling context.
      (ad-activate-advised-definition): Setup ad-Advice-* instead of ad-Orig-*.
      (ad--defalias-fset): Rename from ad-handle-definition.  Make it set the
      function and call ad-activate if needed.
      (ad-activate, ad-deactivate): Don't call ad-handle-definition any more.
      (ad-recover): Clear ad-Advice-* instead of ad-Orig-*.
      (ad-compile-function): Compile ad-Advice-*.
      (ad-activate-on-top-level, ad-with-auto-activation-disabled): Remove.
      (ad-start-advice, ad-stop-advice): Remove.
      3c442f8b
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/cl.el (dolist, dotimes, declare): Use advice-add to · 413d4689
      Stefan Monnier authored
      override the default.
      * lisp/emacs-lisp/cl-macs.el (cl-dolist, cl-dotimes): Rewrite without using
      cl--dotimes/dolist.
      * lisp/subr.el (dolist, dotimes, declare): Redefine them normally, even when
      `cl' is loaded.
      
      * lisp/emacs-lisp/nadvice.el (advice--normalize): New function, extracted
      from add-advice.
      (advice--strip-macro): New function.
      (advice--defalias-fset): Use them to handle macros.
      (advice-add): Use them.
      (advice-member-p): Correctly handle macros.
      413d4689
  5. 12 Nov, 2012 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/nadvice.el: New package. · 231d8498
      Stefan Monnier authored
      * lisp/subr.el (special-form-p): New function.
      * lisp/emacs-lisp/elp.el: Use lexical-binding and advice-add.
      (elp-all-instrumented-list): Remove var.
      (elp-not-profilable): Remove elp-wrapper.
      (elp-profilable-p): Use autoloadp and special-form-p.
      (elp--advice-name): New const.
      (elp-instrument-function): Use advice-add.
      (elp--instrumented-p): New predicate.
      (elp-restore-function): Use advice-remove.
      (elp-restore-all, elp-reset-all): Use mapatoms.
      (elp-set-master): Use elp--instrumented-p.
      (elp--make-wrapper): Rename from elp-wrapper, return a function
      suitable for advice-add.  Use cl-inf.
      (elp-results): Use mapatoms+elp--instrumented-p.
      * lisp/emacs-lisp/debug.el: Use lexical-binding and advice-add.
      (debug-function-list): Remove var.
      (debug): Rename arg, and then let-bind it explicitly inside.
      (debugger-setup-buffer): Rename arg.
      (debugger-setup-buffer): Adjust counts to new debug-on-entry setup.
      (debugger-frame-number): Adjust to new debug-on-entry setup.
      (debug--implement-debug-on-entry): Rename from
      implement-debug-on-entry, add argument.
      (debugger-special-form-p): Remove, use special-form-p instead.
      (debug-on-entry): Use advice-add.
      (debug--function-list): New function.
      (cancel-debug-on-entry): Use it, along with advice-remove.
      (debug-arglist, debug-convert-byte-code, debug-on-entry-1): Remove.
      (debugger-list-functions): Use debug--function-list instead of
      debug-function-list.
      * lisp/emacs-lisp/advice.el (ad-save-real-definition): Remove, unused.
      (ad-special-form-p): Remove, use special-form-p instead.
      (ad-set-advice-info): Use add-function and remove-function.
      (ad--defalias-fset): Adjust accordingly.
      * test/automated/advice-tests.el: New tests.
      231d8498