1. 01 Jan, 2014 1 commit
  2. 12 Dec, 2013 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/nadvice.el: Add `depth' property to manage ordering. · cb3a1380
      Stefan Monnier authored
      (advice--make): Pay attention to `depth'.
      (advice--make-1): Don't autoload commands eagerly.
      * lisp/emacs-lisp/elp.el (elp-instrument-function):
      * lisp/emacs-lisp/trace.el (trace-function-internal):
      * lisp/emacs-lisp/debug.el (debug-on-entry): Keep them "first".
      
      * lisp/iswitchb.el (iswitchb-mode): Don't belittle ido.
      cb3a1380
  3. 17 Nov, 2013 1 commit
  4. 04 Aug, 2013 2 commits
    • 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
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/nadvice.el (advice-function-mapc): Rename from advice-mapc. · 1d44e9dc
      Stefan Monnier authored
      (advice-mapc): New function, using it.
      (advice-function-member-p): New function.
      (advice--normalize): Store the cdr in advice--saved-rewrite since
      that's the part that will be changed.
      (advice--symbol-function): New function.
      (advice-remove): Handle removal before the function is defined.
      Adjust to new advice--saved-rewrite.
      (advice-member-p): Use advice-function-member-p and
      advice--symbol-function.
      1d44e9dc
  5. 26 Jul, 2013 1 commit
  6. 26 Jun, 2013 1 commit
  7. 06 May, 2013 1 commit
  8. 20 Apr, 2013 1 commit
    • Stefan Monnier's avatar
      Use add/remove-function to manipulate process-filters. · bcd7a0a4
      Stefan Monnier authored
      * lisp/emacs-lisp/nadvice.el (advice--where-alist): Add :override.
      (remove-function): Autoload.
      
      * lisp/comint.el (comint-redirect-original-filter-function): Remove.
      (comint-redirect-cleanup, comint-redirect-send-command-to-process):
      * lisp/vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command):
      * lisp/progmodes/octave-inf.el (inferior-octave-send-list-and-digest):
      * lisp/progmodes/prolog.el (prolog-consult-compile):
      * lisp/progmodes/gdb-mi.el (gdb, gdb--check-interpreter):
      Use add/remove-function instead.
      * lisp/progmodes/gud.el (gud-tooltip-original-filter): Remove.
      (gud-tooltip-process-output, gud-tooltip-tips):
      Use add/remove-function instead.
      * lisp/progmodes/xscheme.el (xscheme-previous-process-state): Remove.
      (scheme-interaction-mode, exit-scheme-interaction-mode):
      Use add/remove-function instead.
      
      * lisp/vc/vc-dispatcher.el: Use lexical-binding.
      (vc--process-sentinel): Rename from vc-process-sentinel.
      Change last arg to be the code to run.  Don't use vc-previous-sentinel
      and vc-sentinel-commands any more.
      (vc-exec-after): Allow code to be a function.  Use add/remove-function.
      (compilation-error-regexp-alist, view-old-buffer-read-only): Declare.
      bcd7a0a4
  9. 18 Apr, 2013 1 commit
    • Stefan Monnier's avatar
      * lisp/subr.el (with-wrapper-hook): Declare obsolete. · d36ed1c8
      Stefan Monnier authored
      * lisp/simple.el (filter-buffer-substring-function): New hook.
      (filter-buffer-substring): Use it.
      (filter-buffer-substring-functions): Mark obsolete.
      * lisp/minibuffer.el (completion-in-region-function): New hook.
      (completion-in-region): Use it.
      (completion-in-region-functions): Mark obsolete.
      * lisp/mail/mailabbrev.el (mail-abbrevs-setup): Use abbrev-expand-function.
      * lisp/abbrev.el (abbrev-expand-function): New hook.
      (expand-abbrev): Use it.
      (abbrev-expand-functions): Mark obsolete.
      * lisp/emacs-lisp/nadvice.el (advice--where-alist): Add :filter-args
      and :filter-return.
      * lisp/org/org-agenda.el (org-agenda-mode):
      * lisp/org/org-indent.el (org-indent-mode): Use the `local' arg of
      add-hook/remove-hook.
      d36ed1c8
  10. 16 Apr, 2013 1 commit
  11. 15 Apr, 2013 1 commit
  12. 02 Mar, 2013 1 commit
  13. 15 Jan, 2013 1 commit
  14. 08 Jan, 2013 1 commit
  15. 02 Jan, 2013 1 commit
  16. 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
  17. 15 Nov, 2012 2 commits
  18. 14 Nov, 2012 1 commit
  19. 13 Nov, 2012 2 commits
  20. 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