From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: [PATCH] org-babel-execute-src-block-region Date: Wed, 11 Nov 2015 20:55:57 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e496669fe9305244860c6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwaYq-0005tn-GQ for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 13:56:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwaYo-0002tS-3h for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 13:56:00 -0500 Received: from mail-yk0-x22c.google.com ([2607:f8b0:4002:c07::22c]:36539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwaYn-0002tO-Uj for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 13:55:58 -0500 Received: by ykdr82 with SMTP id r82so64324832ykd.3 for ; Wed, 11 Nov 2015 10:55:57 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Charles C. Berry" Cc: Carlos Henrique Machado S Esteves , emacs-orgmode Mailinglist , Ista Zahn --001a114e496669fe9305244860c6 Content-Type: text/plain; charset=UTF-8 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 :config (require 'poly-R) (require 'poly-org) (add-to-list 'auto-mode-alist '("\\.org" . poly-org-mode)) ) #+END_SRC 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? best z On Wed, Nov 11, 2015 at 7:43 PM, Charles C. Berry 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. >> >> Best, >> Ista >> >> [1] https://github.com/vspinu/polymode >> > > Ista, > > 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") > load-path)) > (require 'poly-org) > (add-to-list 'auto-mode-alist '("\\.org" . poly-org-mode)) > #+END_SRC > > 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. > > Best, > > Chuck > > --001a114e496669fe9305244860c6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thanks Chuck

this sounds very interesti= ng!

i installed polymode from melpa and added this= config

#+BEGIN_SRC emacs-lisp :results none<= /div>
(use-package polymode
=C2=A0:ensure t
=C2=A0:= config
(require 'poly-R)=C2=A0
(require 'poly-o= rg)
(add-to-list 'auto-mode-alist '("\\.org" . = poly-org-mode))
=C2=A0)
#+END_SRC=C2=A0

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

are there additional config needed (keybin= ds, etc?), what am i missing?

best

<= /div>
z

On Wed, Nov 11, 2015 at 7:43 PM, Charles C. Berry &= lt;ccberry@ucsd.edu> 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.

Best,
Ista

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

Ista,

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
=C2=A0 =C2=A0 =C2=A0 (append '("~/elisp/polymode"=C2=A0 "= ;~/elisp/polymode/modes")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 load-path))
(require 'poly-org)
(add-to-list 'auto-mode-alist '("\\.org" . poly-org-mode)= )
#+END_SRC

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.

Best,

Chuck


--001a114e496669fe9305244860c6--