[Top][All Lists]

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

Re: [O] [PATCH] org-babel-execute-src-block-region

From: Xebar Saram
Subject: Re: [O] [PATCH] org-babel-execute-src-block-region
Date: Wed, 11 Nov 2015 20:55:57 +0200

thanks Chuck

this sounds very interesting!

i installed polymode from melpa and added this config

#+BEGIN_SRC emacs-lisp :results none
(use-package polymode
 :ensure t
(require 'poly-R) 
(require 'poly-org)
(add-to-list 'auto-mode-alist '("\\.org" . poly-org-mode))

i then loaded a .org file with R code and entered C-c C-n in the R code block yet nothing happens and the point moves to the end of the block

are there additional config needed (keybinds, etc?), what am i missing?



On Wed, Nov 11, 2015 at 7:43 PM, Charles C. Berry <address@hidden> wrote:
On Wed, 11 Nov 2015, Ista Zahn wrote:

I recommend using polymode[1] as a more general solution to the need to
interact with code blocks without pulling up a separate edit buffer. It
seamlessly switches major modes when point is inside a code block.


[1] https://github.com/vspinu/polymode


Thanks for this pointer. I've been meaning to check out polymode for
some time, and your posting gave me the push to try it out.

For anyone who wants to try it, after cloning into ~/elisp/polymode I
only needed to add this in my init (ESS was already in my init).

#+BEGIN_SRC emacs-lisp
(setq load-path
      (append '("~/elisp/polymode"  "~/elisp/polymode/modes")
(require 'poly-org)
(add-to-list 'auto-mode-alist '("\\.org" . poly-org-mode))

When point is inside a src-block the local mode prevails. So, C-c C-n
inside an R src block sends the line point is on to the R process. C-c
C-c sends the region (or function or paragraph) to the process when
point is in the body. To execute `org-ctrl-c-ctrl-c' on the src block
with the C-c C-c keying, it is necessary to move point to before or
after the body.


Now that I have tried this, I agree that it is better to let polymode
handle this kind of interaction than to try to build it into Org mode.



reply via email to

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