如何以编程方式触发或使用edebug进行检测?

Jis*_*Yoo 5 debugging emacs elisp

C-u C-M-x使用edebug检测评估defun表单.我能以编程方式执行此操作吗?我想这样做是因为我想写一个以下形式的elisp文件:

;;; define a function with edebug instrumented.
...


;;; do something that invokes the function with particular arguments.
...
Run Code Online (Sandbox Code Playgroud)

然后我可以运行emacs -q --load那个elisp文件,逐步执行代码,了解有关错误的进一步调查,在我原来的emacs会话中编辑elisp文件,emacs -q --load再次运行它,然后重复.

abo*_*abo 3

~/test.el

(defun square (x)
  (* x x))
Run Code Online (Sandbox Code Playgroud)

~/testtest.el

(with-current-buffer (find-file-noselect "~/test.el")
  (re-search-forward "square")  
  (edebug-defun))
(square 5)
Run Code Online (Sandbox Code Playgroud)

bash

emacs -q -l ~/testtest.el
Run Code Online (Sandbox Code Playgroud)