From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: Re: [PATCH] org-babel-execute-src-block-region Date: Wed, 11 Nov 2015 08:44:57 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11429142450f5905244408dc Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwVhs-00084f-Sn for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 08:45:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwVhr-0005Vh-Ib for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 08:45:00 -0500 Received: from mail-yk0-x22d.google.com ([2607:f8b0:4002:c07::22d]:35635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwVhr-0005VW-D9 for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 08:44:59 -0500 Received: by ykba77 with SMTP id a77so48290071ykb.2 for ; Wed, 11 Nov 2015 05:44:58 -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: Xebar Saram Cc: Carlos Henrique Machado S Esteves , emacs-orgmode Mailinglist , Charles Berry --001a11429142450f5905244408dc Content-Type: text/plain; charset=UTF-8 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 On Nov 11, 2015 12:11 AM, "Xebar Saram" wrote: > Hi > > I actually find it annoying in ESS to keep pressing C-c ' each time i want > to eval a single line of code in a code block. if this could work for R > code this would be fantastic for me > > thx > > Z > > On Tue, Nov 10, 2015 at 8:19 PM, Carlos Henrique Machado S Esteves < > ch.machado.esteves@gmail.com> wrote: > >> Hello Chuck, >> >> Thank you for the feedback. >> >> > You might want to check that point and mark are both inside the src >> block. Otherwise, the results are unpredictable. >> You are right, I've updated the patch. >> >> > ess-mode, python-mode, sh-mode and octave-mode already provide this >> capability (and a lot more) for R, python, shell scripts, octave/matlab and >> some other languages from the edit buffer. >> I understand that. My idea is to avoid the need to C-c ' back and forth. >> Actually that's a problem I have with org-babel; I usually find myself >> coding inside the src block and losing many of the major mode >> functionalities; switching to the edit buffer often seem too much of a >> hassle. Any tips about how to get more major-mode functionalities inside >> the src-block? Or should I develop the muscle memory to switch back and >> forth to the edit buffer all the time? >> >> > `org-babel-demarcate-block' gives the user the ability to break up src >> blocks into smaller pieces so they can be run independently. >> Thanks for pointing that; I didn't know about `org-babel-demarcate-block'. >> >> Best, >> >> Carlos >> >> 2015-11-02 13:19 GMT-05:00 Charles C. Berry : >> >>> On Sun, 1 Nov 2015, Carlos Henrique Machado S Esteves wrote: >>> >>> Hello, I find it useful to be able to execute only a region of a source >>>> code block, so I've implemented a new function for that. I've tested it >>>> with MATLAB and Python, but it should work for any mode, since it calls >>>> org-babel-execute-src-block. >>>> >>>> >>> You might want to check that point and mark are both inside the src >>> block. Otherwise, the results are unpredictable. >>> >>> Also note that: >>> >>> ess-mode, python-mode, sh-mode and octave-mode already provide this >>> capability (and a lot more) for R, python, shell scripts, octave/matlab and >>> some other languages from the edit buffer. >>> >>> `org-babel-demarcate-block' gives the user the ability to break up src >>> blocks into smaller pieces so they can be run independently. >>> >>> Best, >>> >>> Chuck >>> >>> >> > --001a11429142450f5905244408dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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

Best,
Ista

[1] https://g= ithub.com/vspinu/polymode

On Nov 11, 2015 12:11 AM, "Xebar Saram"= ; <zeltakc@gmail.com> wrote:=
Hi=

I actually find it annoying in ESS to keep pressing C-c= ' each time i want to eval a single line of code in a code block. if t= his could work for R code this would be fantastic for me

thx

Z

On Tue, Nov 10, 2015 at 8:19 PM, Carlos Hen= rique Machado S Esteves <ch.machado.esteves@gmail.com> wrote:
<= div>
Hello Chuck,

Thank you for the feedback.
> You might want to check that point and mark are both insid= e the src block. Otherwise, the results are unpredictable.
= You are right, I've updated the patch.

> ess-mode, pyth= on-mode, sh-mode and octave-mode already provide this=20 capability (and a lot more) for R, python, shell scripts, octave/matlab=20 and some other languages from the edit buffer.
I understand= that. My idea is to avoid the need to C-c ' back and forth. Actually t= hat's a problem I have with org-babel; I usually find myself coding ins= ide the src block and losing many of the major mode functionalities; switch= ing to the edit buffer often seem too much of a hassle. Any tips about how = to get more major-mode functionalities inside the src-block? Or should I de= velop the muscle memory to switch back and forth to the edit buffer all the= time?

> `org-babel-demarcate-block' gives the user the ability to break up= src=20 blocks into smaller pieces so they can be run independently.
Thanks for pointing that; I didn't know about `org-babel-demarcate-bl= ock'.

Best,

Carlos

2015-11-02 13:19 GMT-05:= 00 Charles C. Berry <ccberry@ucsd.edu>:
On Sun, 1 Nov 2015, Carlos Henrique Machado S Esteves w= rote:

Hello, I find it useful to be able to execute only a region of a source
code block, so I've implemented a new function for that. I've teste= d it
with MATLAB and Python, but it should work for any mode, since it calls
org-babel-execute-src-block.


You might want to check that point and mark are both inside the src block. = Otherwise, the results are unpredictable.

Also note that:

ess-mode, python-mode, sh-mode and octave-mode already provide this capabil= ity (and a lot more) for R, python, shell scripts, octave/matlab and some o= ther languages from the edit buffer.

`org-babel-demarcate-block' gives the user the ability to break up src = blocks into smaller pieces so they can be run independently.

Best,

Chuck



--001a11429142450f5905244408dc--