You may be able to do this by surrounding definitions of function you want to instrument with (edebug-all-defs)
.
(edebug-all-defs)
;; this one is instrumented
(defun foo ()
(bar))
;; this one is, too
(defun bar ()
(message "hi!"))
(edebug-all-defs)
;; this one is not
(defun baz ()
(bar))
Now foo
and bar
are instrumented, and baz
is not.
I found this by pressing C-h k C-M-x
and reading the doc. string, which pointed me to edebug-all-defs
. Its documentation string says this:
edebug-all-defs
is a variable defined in edebug.el
.
Its value is nil
Documentation:
If non-nil, evaluating defining forms instruments for Edebug.
This applies to eval-defun
, eval-region
, eval-buffer
, and
eval-current-buffer
. eval-region
is also called by
eval-last-sexp
, and eval-print-last-sexp
.
You can use the command edebug-all-defs
to toggle the value of this
variable. You may wish to make it local to each buffer with
(make-local-variable 'edebug-all-defs)
in your
emacs-lisp-mode-hook
.