summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/testcover.el
diff options
context:
space:
mode:
authorGemini Lasswell <gazally@runbox.com>2017-10-14 09:13:36 -0700
committerGemini Lasswell <gazally@runbox.com>2017-10-22 10:47:50 -0700
commite07cf691decf01dc3cbe19a413708570b95bc41b (patch)
tree0500a27e83dcef7fdf5bb846562e9d92c67fbf58 /lisp/emacs-lisp/testcover.el
parent9c8f8de0f3e00d4f862fa5c17e3b46fcd23e5f7f (diff)
downloademacs-e07cf691decf01dc3cbe19a413708570b95bc41b.tar.gz
Change Edebug's behavior-changing hooks to variables
* lisp/emacs-lisp/edebug.el (edebug-after-instrumentation-functions) (edebug-new-definition-functions): Deleted. (edebug-after-instrumentation-function) (edebug-new-definition-function): New variables. (edebug-behavior-alist): Update docstring. (edebug-read-and-maybe-wrap-form1, edebug-make-form-wrapper): Use new variables. * lisp/emacs-lisp/testcover.el (testcover-start) (testcover-this-defun): Use `edebug-after-instrumentation-function' and `edebug-new-definition-function'. (testcover-after-instrumentation): Return passed form. (testcover-init-definition): Use argument instead of `edebug-def-name'. * doc/lispref/edebug.texi (Edebug Options): Replace descriptions of `edebug-after-instrumentation-functions' and `edebug-new-definition-functions' with `edebug-after-instrumentation-function' and `edebug-new-definition-function'.
Diffstat (limited to 'lisp/emacs-lisp/testcover.el')
-rw-r--r--lisp/emacs-lisp/testcover.el23
1 files changed, 9 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 3628968974c..797cc682171 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -193,12 +193,9 @@ If BYTE-COMPILE is non-nil, byte compile each function after instrumenting."
testcover-module-constants nil
testcover-module-1value-functions nil
testcover-module-potentially-1value-functions nil)
- (cl-letf ((edebug-all-defs t)
- (edebug-after-instrumentation-functions)
- (edebug-new-definition-functions))
- (add-hook 'edebug-after-instrumentation-functions 'testcover-after-instrumentation)
- (add-hook 'edebug-new-definition-functions 'testcover-init-definition)
- (remove-hook 'edebug-new-definition-functions 'edebug-announce-definition)
+ (let ((edebug-all-defs t)
+ (edebug-after-instrumentation-function #'testcover-after-instrumentation)
+ (edebug-new-definition-function #'testcover-init-definition))
(eval-buffer buf)))
(when byte-compile
(dolist (x (reverse edebug-form-data))
@@ -210,12 +207,9 @@ If BYTE-COMPILE is non-nil, byte compile each function after instrumenting."
(defun testcover-this-defun ()
"Start coverage on function under point."
(interactive)
- (cl-letf ((edebug-all-defs t)
- (edebug-after-instrumentation-functions)
- (edebug-new-definition-functions))
- (add-hook 'edebug-after-instrumentation-functions 'testcover-after-instrumentation)
- (add-hook 'edebug-new-definition-functions 'testcover-init-definition)
- (remove-hook 'edebug-new-definition-functions 'edebug-announce-definition)
+ (let ((edebug-all-defs t)
+ (edebug-after-instrumentation-function #'testcover-after-instrumentation)
+ (edebug-new-definition-function #'testcover-init-definition))
(eval-defun nil)))
(defun testcover-end (filename)
@@ -231,11 +225,12 @@ If BYTE-COMPILE is non-nil, byte compile each function after instrumenting."
(defun testcover-after-instrumentation (form)
"Analyze FORM for code coverage."
- (testcover-analyze-coverage form))
+ (testcover-analyze-coverage form)
+ form)
(defun testcover-init-definition (sym)
"Mark SYM as under test coverage."
- (message "Testcover: %s" edebug-def-name)
+ (message "Testcover: %s" sym)
(put sym 'edebug-behavior 'testcover))
(defun testcover-enter (func _args body)