5

I want to use interactive debugging of R code in emacs, and found about ess-tracebug, but can't get it to work. I did the following:

  1. Installed ess-tracebug
  2. Started execution of an R script with ESS C-c C-n
  3. Set up a breakpoint, now if I try to do M-c c, says "Debugging is not active"

Here is what I added to my ~/.emacs file:

(load "/home/user/ess/ess-5.13/lisp/ess-site")
(ess-toggle-underscore nil)
(add-to-list 'load-path "/home/user/emacs/")
(require 'ess-tracebug)
(add-hook 'ess-post-run-hook 'ess-tracebug t)
(define-key ess-mode-map "\M-]" 'next-error)
(define-key ess-mode-map "\M-[" 'previous-error)
(define-key inferior-ess-mode-map "\M-]" 'next-error-no-select)
(define-key inferior-ess-mode-map "\M-[" 'previous-error-no-select)

Any suggestions?

Jonas Stein
  • 6,826
  • 7
  • 40
  • 72
719016
  • 9,922
  • 20
  • 85
  • 158

1 Answers1

7

I assume you are running R in an Emacs buffer and you have your script in another buffer. In order to debug with ess-tracebug you must type M-x ess-tracebug to start the actual tracebug session.

This should do the job.

Jonas Stein
  • 6,826
  • 7
  • 40
  • 72
GdA
  • 86
  • 2
  • 1
    Yes that's exactly right, as homepage also says you can activate ess-tracebug every time R session starts with `(add-hook 'ess-post-run-hook 'ess-tracebug)` – VitoshKa Feb 21 '12 at 17:50