emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Ista Zahn
Subject: Re: [O] [PATCH] org-babel-execute-src-block-region
Date: Wed, 11 Nov 2015 08:44:57 -0500

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" <address@hidden> 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 <address@hidden> 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 <address@hidden>:
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




reply via email to

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