How to programmatically run or use the edebug tool?

Cu CMx evaluates defun form with the edebug tool. Can I do this programmatically? I want to do this because I want to write an elisp file of the following form:

 ;;; define a function with edebug instrumented. ... ;;; do something that invokes the function with particular arguments. ... 

then I can run emacs -q --load in this elisp file, go through the code, get an idea of ​​further investigation of the error, edit the elisp file in my original emacs session, run emacs -q --load and try again.

+4
source share
1 answer

In ~/test.el :

 (defun square (x) (* xx)) 

In ~/testtest.el :

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

In bash :

 emacs -q -l ~/testtest.el 
+3
source

Source: https://habr.com/ru/post/1500159/


All Articles