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 07:10:52 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e4d7cb2bd4105243cd982 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwNgM-0008M0-VN for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 00:10:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwNgL-0007Rl-JW for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 00:10:54 -0500 Received: from mail-yk0-x233.google.com ([2607:f8b0:4002:c07::233]:34702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwNgL-0007RU-Cl for emacs-orgmode@gnu.org; Wed, 11 Nov 2015 00:10:53 -0500 Received: by ykfs79 with SMTP id s79so33100285ykf.1 for ; Tue, 10 Nov 2015 21:10:52 -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: Carlos Henrique Machado S Esteves Cc: org mode , "Charles C. Berry" --001a114e4d7cb2bd4105243cd982 Content-Type: text/plain; charset=UTF-8 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 >> >> > --001a114e4d7cb2bd4105243cd982 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi

I actually find it annoying in ESS t= o 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 tha= t 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=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 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 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



--001a114e4d7cb2bd4105243cd982--