* Split source block at point
@ 2013-11-27 7:15 Alexander Baier
2013-11-27 7:17 ` Jambunathan K
2013-11-27 7:37 ` Christian Moe
0 siblings, 2 replies; 5+ messages in thread
From: Alexander Baier @ 2013-11-27 7:15 UTC (permalink / raw)
To: emacs-orgmode
Hello together,
is therer a command or a function that lets me split a source block at a
given position? I think what I mean is best demonstrated by looking at
an example:
Given this buffer:
----------------------------------------------------------------
begin_src emacs-lisp
(defun foo ()
(bar))
(baz (foo))
end_src
----------------------------------------------------------------
With point somewhere at the free line I want to invoke the split
function and get this:
----------------------------------------------------------------
begin_src emacs-lisp
(defun foo ()
(bar))
end_src
begin_src emacs-lisp
(baz (foo))
end_src
----------------------------------------------------------------
This is similar to what M-RET does in message-mode.
Do we already have something like this in org? And if not, do you think
this is useful? Personally I find myself quite frequently splitting up
soure blocks manually.
Best regards,
--
Alexander Baier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Split source block at point
2013-11-27 7:15 Split source block at point Alexander Baier
@ 2013-11-27 7:17 ` Jambunathan K
2013-11-27 7:18 ` Jambunathan K
2013-11-27 7:39 ` Alexander Baier
2013-11-27 7:37 ` Christian Moe
1 sibling, 2 replies; 5+ messages in thread
From: Jambunathan K @ 2013-11-27 7:17 UTC (permalink / raw)
To: Alexander Baier; +Cc: emacs-orgmode
C-h K C-c C-v C-d
Alexander Baier <lexi.baier@gmail.com> writes:
> Hello together,
>
> is therer a command or a function that lets me split a source block at a
> given position? I think what I mean is best demonstrated by looking at
> an example:
>
> Given this buffer:
> ----------------------------------------------------------------
> begin_src emacs-lisp
> (defun foo ()
> (bar))
>
> (baz (foo))
> end_src
> ----------------------------------------------------------------
>
> With point somewhere at the free line I want to invoke the split
> function and get this:
> ----------------------------------------------------------------
> begin_src emacs-lisp
> (defun foo ()
> (bar))
> end_src
>
> begin_src emacs-lisp
> (baz (foo))
> end_src
> ----------------------------------------------------------------
> This is similar to what M-RET does in message-mode.
>
> Do we already have something like this in org? And if not, do you think
> this is useful? Personally I find myself quite frequently splitting up
> soure blocks manually.
>
> Best regards,
> --
> Alexander Baier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Split source block at point
2013-11-27 7:17 ` Jambunathan K
@ 2013-11-27 7:18 ` Jambunathan K
2013-11-27 7:39 ` Alexander Baier
1 sibling, 0 replies; 5+ messages in thread
From: Jambunathan K @ 2013-11-27 7:18 UTC (permalink / raw)
To: Alexander Baier; +Cc: emacs-orgmode
Jambunathan K <kjambunathan@gmail.com> writes:
> C-h K C-c C-v C-d
^
^
k
Looks like the keybindings are not indexed the canonical way in the Org
manual.
> Alexander Baier <lexi.baier@gmail.com> writes:
>
>> Hello together,
>>
>> is therer a command or a function that lets me split a source block at a
>> given position? I think what I mean is best demonstrated by looking at
>> an example:
>>
>> Given this buffer:
>> ----------------------------------------------------------------
>> begin_src emacs-lisp
>> (defun foo ()
>> (bar))
>>
>> (baz (foo))
>> end_src
>> ----------------------------------------------------------------
>>
>> With point somewhere at the free line I want to invoke the split
>> function and get this:
>> ----------------------------------------------------------------
>> begin_src emacs-lisp
>> (defun foo ()
>> (bar))
>> end_src
>>
>> begin_src emacs-lisp
>> (baz (foo))
>> end_src
>> ----------------------------------------------------------------
>> This is similar to what M-RET does in message-mode.
>>
>> Do we already have something like this in org? And if not, do you think
>> this is useful? Personally I find myself quite frequently splitting up
>> soure blocks manually.
>>
>> Best regards,
>> --
>> Alexander Baier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Split source block at point
2013-11-27 7:17 ` Jambunathan K
2013-11-27 7:18 ` Jambunathan K
@ 2013-11-27 7:39 ` Alexander Baier
1 sibling, 0 replies; 5+ messages in thread
From: Alexander Baier @ 2013-11-27 7:39 UTC (permalink / raw)
To: Jambunathan K; +Cc: emacs-orgmode
On 13-11-27 08:17 Jambunathan K wrote:
> C-h K C-c C-v C-d
>
>
> Alexander Baier <lexi.baier@gmail.com> writes:
>
>> Hello together,
>>
>> is therer a command or a function that lets me split a source block at a
>> given position? I think what I mean is best demonstrated by looking at
>> an example:
>>
>> Given this buffer:
>> ----------------------------------------------------------------
>> begin_src emacs-lisp
>> (defun foo ()
>> (bar))
>>
>> (baz (foo))
>> end_src
>> ----------------------------------------------------------------
>>
>> With point somewhere at the free line I want to invoke the split
>> function and get this:
>> ----------------------------------------------------------------
>> begin_src emacs-lisp
>> (defun foo ()
>> (bar))
>> end_src
>>
>> begin_src emacs-lisp
>> (baz (foo))
>> end_src
>> ----------------------------------------------------------------
>> This is similar to what M-RET does in message-mode.
>>
>> Do we already have something like this in org? And if not, do you think
>> this is useful? Personally I find myself quite frequently splitting up
>> soure blocks manually.
>>
>> Best regards,
>> --
>> Alexander Baier
This works like a charm, thank you!
Best regards,
--
Alexander Baier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Split source block at point
2013-11-27 7:15 Split source block at point Alexander Baier
2013-11-27 7:17 ` Jambunathan K
@ 2013-11-27 7:37 ` Christian Moe
1 sibling, 0 replies; 5+ messages in thread
From: Christian Moe @ 2013-11-27 7:37 UTC (permalink / raw)
To: Alexander Baier; +Cc: emacs-orgmode
Alexander Baier writes:
> Hello together,
>
> is therer a command or a function that lets me split a source block at a
> given position? I think what I mean is best demonstrated by looking at
> an example:
C-c C-v d (org-babel-demarcate-block)
Yours,
Christian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-27 7:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 7:15 Split source block at point Alexander Baier
2013-11-27 7:17 ` Jambunathan K
2013-11-27 7:18 ` Jambunathan K
2013-11-27 7:39 ` Alexander Baier
2013-11-27 7:37 ` Christian Moe
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).