emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org babel, ess, R


From: Charles C. Berry
Subject: Re: [O] org babel, ess, R
Date: Mon, 3 Jul 2017 19:17:13 -0700
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

On Tue, 4 Jul 2017, Vikas Rawal wrote:


On 04-Jul-2017, at 1:22 AM, John Hendy <address@hidden> wrote:

On Sun, Jul 2, 2017 at 7:17 PM, Vikas Rawal
<address@hidden> wrote:

Vikas Rawal <address@hidden> writes:

Isn’t is what most users need while editing the code block? The
possibility of evaluating the code to test and see what happens?

Often, but not always. And it would be seriously annoying to have the session buffer pop up every time I wanted to browse the code in a src block while simultaneously viewing the results of a previous invocation in the org buffer.

As noted by others C-RET (or C-c C-n) on an empty line will make the session buffer visible.

So will C-c C-z C-c C-z if you are in an ESS[S] mode buffer (and it will do that without trying to eval anything).

There are any number of possibilities for customizing =org-edit-src-code= to your liking. For example, with this code C-c M-' will display the edit buffer and the session buffer as desired by Vikas:

#+BEGIN_SRC emacs-lisp
  (defun my-babel-edit-src (&optional code edit-buffer)
    (interactive)
    (org-edit-src-code code edit-buffer)
     (when (string= mode-name "ESS[S]")
       (let ((cb (current-buffer)))
         (ess-switch-to-ESS t)
         (switch-to-buffer-other-window cb))))
  (define-key org-mode-map (kbd "\C-c\M-'") 'my-babel-edit-src)
#+END_SRC

There are loads of possibilities. Just hack away at that function to add stops and whistles.

Personally, I find that the code in this thread:

From: Andrew Kirkpatrick <address@hidden>
Subject: Jumping between source blocks in a file
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/103130>

has done a lot to ease my browsing and manipulation of src blocks even though it displays the org buffer along with the edit buffer --- requiring me to key in C-c C-z C-c C-z to get the process buffer back in view. I suppose I could replace =org-edit-src-code= at the end of Andrew Kirkpatrick's =my-babel-src-jump= with =my-babel-src-code= to fix that. Maybe tomorrow...

Best,

Chuck

reply via email to

[Prev in Thread] Current Thread [Next in Thread]