From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos Henrique Machado S Esteves Subject: Re: [PATCH] org-babel-execute-src-block-region Date: Tue, 10 Nov 2015 13:19:35 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a114e52f6895e27052433c06f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwDW5-00037H-Ua for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 13:19:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwDW4-0003d8-J4 for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 13:19:37 -0500 Received: from mail-yk0-x236.google.com ([2607:f8b0:4002:c07::236]:34634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwDW4-0003cj-Cc for emacs-orgmode@gnu.org; Tue, 10 Nov 2015 13:19:36 -0500 Received: by ykfs79 with SMTP id s79so8105379ykf.1 for ; Tue, 10 Nov 2015 10:19:35 -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: emacs-orgmode@gnu.org --001a114e52f6895e27052433c06f Content-Type: multipart/alternative; boundary=001a114e52f6895e21052433c06d --001a114e52f6895e21052433c06d Content-Type: text/plain; charset=UTF-8 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 > > --001a114e52f6895e21052433c06d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Chuck,

Th= ank you for the feedback.

> You might want to check that point a= nd mark are both inside the src block. Otherwise, the results are unpredict= able.
You are right, I've updated the patch.

> ess-m= ode, 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 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 t= he muscle memory to switch back and forth to the edit buffer all the time?<= br>
> `org-babel-demarcate-block' gives the user the ability to break up= src=20 blocks into smaller pieces so they can be run independently.
Thank= s for pointing that; I didn't know about `org-babel-demarcate-block'= ;.

Best,

Carlos

2015-11-02 13:19 GMT-05:00 Charles C. Ber= ry <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


--001a114e52f6895e21052433c06d-- --001a114e52f6895e27052433c06f Content-Type: text/x-patch; charset=US-ASCII; name="0001-ob-core.el-Allow-execution-of-region-of-source-code-.patch" Content-Disposition: attachment; filename="0001-ob-core.el-Allow-execution-of-region-of-source-code-.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_igtp9do10 RnJvbSBiNjc3YWQ0NDE2ZDllOGRkNTY0YTQ2ZmNiNDEzNmNmNmY1YTkwYjI5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDYXJsb3MgSE1TIEVzdGV2ZXMgPGNoLm1hY2hhZG8uZXN0ZXZl c0BnbWFpbC5jb20+CkRhdGU6IFN1biwgMSBOb3YgMjAxNSAyMDo1MjoyNiAtMDUwMApTdWJqZWN0 OiBbUEFUQ0hdIG9iLWNvcmUuZWw6IEFsbG93IGV4ZWN1dGlvbiBvZiByZWdpb24gb2Ygc291cmNl IGNvZGUgYmxvY2sKCiogb2ItY29yZS5lbCAob3JnLWJhYmVsLWV4ZWN1dGUtc3JjLWJsb2NrLXJl Z2lvbik6IEV4ZWN1dGUgb25seSBhY3RpdmUgcmVnaW9uIG9mCnRoZSBjdXJyZW50IHNvdXJjZSBi bG9jay4gIFNhbWUgYXMgYG9yZy1iYWJlbC1leGVjdXRlLXNyYy1ibG9jaycsIGJ1dAp1c2Ugb25s eSB0aGUgYWN0aXZlIHJlZ2lvbiBpbnN0ZWFkIG9mIHRoZSB3aG9sZSBibG9jay4KClRJTllDSEFO R0UKLS0tCiBsaX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