From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Vikas Rawal <vikaslists@agrarianresearch.org>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>,
Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: org babel, ess, R
Date: Wed, 5 Jul 2017 22:25:11 -0700 [thread overview]
Message-ID: <alpine.OSX.2.20.1707052158540.1642@charles-berrys-macbook.local> (raw)
In-Reply-To: <7F043BA1-473D-444F-84D9-2ED662793C60@agrarianresearch.org>
[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]
On Wed, 5 Jul 2017, Vikas Rawal wrote:
>>>
>>> "... I'd like Org to pick up the fact that there's a :session
>>> argument with a custom name and use that for C-RET in the edit buffer;
>>> otherwise it generates the default *R* session there, but if you C-c
>>> C-c the block later it puts it into the custom session name."
>>
>> This is what `org-babel-switch-to-session-with-code' does. BTW, it
>> also handles Vikas' original issue of displaying both the edit buffer
>> and the process buffer during editing src blocks.
>>
>> So you might want is to use `org-babel-switch-to-session-with-code'
>> rather than `org-edit-src-code’.
>
> Indeed this does what I was originally looking for. How does one exit
> from this neatly? What is the equivalent of org-edit-src-exit to use
> with this? Using org-edit-src-exit after
> org-babel-switch-to-session-with-code does not close the session window.
>
It doesn't do that now, but see below.
>> I do not think I'd want to replace `org-edit-src-code' in
>> `org-edit-special' with that function by default, since it forces a
>> session to start and displays the process buffer which is kind of
>> annoying when all I want to do is browse code in an edit buffer. It
>> fails with an error when applied to a src block with no session, so
>> that would need to be handled if `o-b-s-t-session-w-code' is supplied
>> as an option.
>>
>
> Yes, that makes sense.
OTOH, maybe a call to `org-babel-switch-to-session-with-code' could
replace the `(switch-to-buffer ...)' in `org-edit-special' so C-u C-c '
would display the process buffer (as it does now) and also the edit buffer
and start a new process if necessary.
But there are a few things to fix. `org-babel-switch-to-session-with-code'
needs to set `org-src--saved-temp-window-config' after the call to
'org-edit-src-code' so `org-edit-src-exit' can restore the window setup.
Also, it might as well use 'info' which `org-edit-special' obtains for src
blocks when ARG is set.
Chuck
next prev parent reply other threads:[~2017-07-06 5:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-01 1:36 org babel, ess, R Vikas Rawal
2017-07-01 3:38 ` Vikas Rawal
2017-07-01 12:53 ` Nicolas Goaziou
2017-07-02 2:48 ` Vikas Rawal
2017-07-02 7:05 ` Nicolas Goaziou
2017-07-03 0:17 ` Vikas Rawal
2017-07-03 2:21 ` Andreas Kiermeier
2017-07-03 2:28 ` Vikas Rawal
2017-07-03 2:35 ` Andreas Kiermeier
2017-07-03 19:52 ` John Hendy
2017-07-03 23:19 ` Vikas Rawal
2017-07-04 2:17 ` Charles C. Berry
2017-07-04 9:20 ` Vikas Rawal
2017-07-05 21:22 ` Nicolas Goaziou
2017-07-05 21:58 ` John Hendy
2017-07-06 4:42 ` Charles C. Berry
2017-07-06 4:53 ` Vikas Rawal
2017-07-06 5:25 ` Charles C. Berry [this message]
2017-07-07 11:57 ` Nicolas Goaziou
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=alpine.OSX.2.20.1707052158540.1642@charles-berrys-macbook.local \
--to=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
--cc=vikaslists@agrarianresearch.org \
/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).