I want to be able to execute code line-by-line in a chunk of code that is in a org buffer. My goal is to execute code line-by-line without having to run all the code inside a chunk at once (C-c C-c), and without having to switch to a special buffer (C-c '). I use R, but it could be applied to any other language. Is there a way to do this?
Example: Execute only the first line in the following chunk of code, such that the variable a gets the value 7 in the session.
#+BEGIN_SRC R :session
a <- 3 + 4
a <- 5 + 6
#+END_SRC
#+RESULTS:
? Otherwise, it is trivial to do this by runningM-x ess-eval-region-or-line-and-step
as you said. You could give this a key binding and use it even if your buffer is not in ess-mode – Tombola#+RESULTS:
. I just want to run some specific lines without having to switch to the special buffer. I triedM-x ess-eval-region-or-line-and-step
but I get prompted for the dialect, and after choosing R emacs hangs. I am using spacemacs. Not sure that's the reason. – Dueless-eval-region-or-line-and-step
works for me using Emacs 24.3.1, R version 3.1.2, and org version 20130802 when I'm in org-mode. – Tombola# stuff
, and somehow the cursor ended up there. Thanks! – Duel