Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracebug: add keybindings for remaining browser commands #1260

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions lisp/ess-tracebug.el
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,11 @@ the output into *ess.dbg* buffer."
(define-key map (kbd "M-C") #'ess-debug-command-continue)
(define-key map [(control meta ?C)] #'ess-debug-command-continue-multi)
(define-key map (kbd "M-N") #'ess-debug-command-next)
(define-key map (kbd "M-S") #'ess-debug-command-step)
(define-key map (kbd "M-W") #'ess-debug-command-where)
(define-key map (kbd "M-F") #'ess-debug-command-finish)
(define-key map (kbd "M-H") #'ess-debug-command-help)
(define-key map (kbd "M-R") #'ess-debug-command-resume)
(define-key map [(control meta ?N)] #'ess-debug-command-next-multi)
(define-key map (kbd "M-Q") #'ess-debug-command-quit)
(define-key map (kbd "M-U") #'ess-debug-command-up)
Expand Down Expand Up @@ -1785,6 +1790,61 @@ Equivalent to `n' at the R prompt."
(ess-send-string (ess-get-process) "0")
(ess-send-string (ess-get-process) "n")))

(defun ess-debug-command-step ()
"Step into in debug mode.
Equivalent to `s' at the R prompt."
(interactive)
(ess-force-buffer-current)
(unless (ess--dbg-is-active-p)
(error "Debugger is not active"))
(if (ess--dbg-is-recover-p)
(ess-send-string (ess-get-process) "0")
(ess-send-string (ess-get-process) "s")))

(defun ess-debug-command-finish ()
"Step next in debug mode.
Equivalent to `f' at the R prompt."
(interactive)
(ess-force-buffer-current)
(unless (ess--dbg-is-active-p)
(error "Debugger is not active"))
(if (ess--dbg-is-recover-p)
(progn (ess-send-string (ess-get-process) "0")
(ess-send-string (ess-get-process) "f"))
(ess-send-string (ess-get-process) "f")))


(defun ess-debug-command-resume ()
"Step next in debug mode.
Equivalent to `f' at the R prompt."
(interactive)
(ess-force-buffer-current)
(unless (ess--dbg-is-active-p)
(error "Debugger is not active"))
(if (ess--dbg-is-recover-p)
(progn (ess-send-string (ess-get-process) "0")
(ess-send-string (ess-get-process) "r"))
(ess-send-string (ess-get-process) "r")))

(defun ess-debug-command-where ()
"Step next in debug mode.
Equivalent to `where' at the R prompt."
(interactive)
(ess-force-buffer-current)
(unless (ess--dbg-is-active-p)
(error "Debugger is not active"))
(ess-send-string (ess-get-process) "where"))


(defun ess-debug-command-help ()
"Step next in debug mode.
Equivalent to `where' at the R prompt."
(interactive)
(ess-force-buffer-current)
(unless (ess--dbg-is-active-p)
(error "Debugger is not active"))
(ess-send-string (ess-get-process) "help"))

(defun ess-debug-command-next-multi (&optional N)
"Ask for N and step (n) N times in debug mode."
(interactive)
Expand Down