Debugging 如何以编程方式触发或插入edebug?

Debugging 如何以编程方式触发或插入edebug?,debugging,emacs,elisp,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. ... 然后,我可以在该elisp文件上运行emacs-q--load,逐步执行代码,了解关于该bu

C-u C-M-x
在检测到edebug的情况下评估defun表单。我可以用编程的方式做吗?我之所以要这样做,是因为我要编写以下形式的elisp文件:

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


;;; do something that invokes the function with particular arguments.
...

然后,我可以在该elisp文件上运行
emacs-q--load
,逐步执行代码,了解关于该bug的进一步调查,在最初的emacs会话中编辑elisp文件,再次在其上运行
emacs-q--load
,然后重复

(defun square (x)
  (* x x))
(with-current-buffer (find-file-noselect "~/test.el")
  (re-search-forward "square")  
  (edebug-defun))
(square 5)
~/testtest.el
中:

(defun square (x)
  (* x x))
(with-current-buffer (find-file-noselect "~/test.el")
  (re-search-forward "square")  
  (edebug-defun))
(square 5)
bash
中:

emacs -q -l ~/testtest.el