Has anyone found any way to step through the code using edebug and see how variables change on each step in the backtrace? On my emacs each time you run edebug-next-mode
backtrace disappears and you have to invoke it again, which quickly turns into a difficult workflow.
1 Answer
As a poor man's workaround I've rebound d
to open backtrace and go back to the main window (so by pressing quickly n
for next-mode
and d
for this funciton with a bit of flickering you can somewhat step through AND have a traceback):
(defun edebug-pop-to-backtrace-and-return ()
(interactive)
(edebug-pop-to-backtrace)
(windmove-up))
(map! :map edebug-mode-map "d" 'edebug-pop-to-backtrace-and-return)
This is by not means a solution. If anyone found a better way to do it please let me know.
UPDATE: This won't work if you also want to watch local variables. Still looking for a "proper" solution...
add-variable-watcher
? (Never tried, myself.)add-variable-watcher
function in my emacs, it led me to another function calleddebug-on-variable-change
and what looks like a fantastic resource on doom emacs in general: emacsdocs.org/docs/elisp/Variable-Debuggingadd-variable-watcher
and related functions were added in Emacs 28, I think.