emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ista Zahn <istazahn@gmail.com>
To: Xebar Saram <zeltakc@gmail.com>
Cc: Carlos Henrique Machado S Esteves <ch.machado.esteves@gmail.com>,
	emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>,
	Charles Berry <ccberry@ucsd.edu>
Subject: Re: [PATCH] org-babel-execute-src-block-region
Date: Wed, 11 Nov 2015 08:44:57 -0500	[thread overview]
Message-ID: <CA+vqiLFgP=tjV3yZgiMvGibjPjgE46MyVgDnHuJbj_SvErGwLw@mail.gmail.com> (raw)
In-Reply-To: <CAOQHXPqn=RY8eMOro9spyjX6N-E_VnNHzMp3w43N=jkoQfp9JQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2757 bytes --]

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" <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 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 <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 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
>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4017 bytes --]

  reply	other threads:[~2015-11-11 13:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02  2:17 [PATCH] org-babel-execute-src-block-region Carlos Henrique Machado S Esteves
2015-11-02 18:19 ` Charles C. Berry
2015-11-10 18:19   ` Carlos Henrique Machado S Esteves
2015-11-11  0:08     ` Nicolas Goaziou
2015-11-11  5:10     ` Xebar Saram
2015-11-11 13:44       ` Ista Zahn [this message]
2015-11-11 17:43         ` Charles C. Berry
2015-11-11 18:55           ` Xebar Saram
2015-11-11 21:53             ` Charles C. Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+vqiLFgP=tjV3yZgiMvGibjPjgE46MyVgDnHuJbj_SvErGwLw@mail.gmail.com' \
    --to=istazahn@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=ch.machado.esteves@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=zeltakc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).