From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: Re: org babel, ess, R Date: Thu, 6 Jul 2017 10:23:56 +0530 Message-ID: <7F043BA1-473D-444F-84D9-2ED662793C60@agrarianresearch.org> References: <87mv8o2u9b.fsf@nicolasgoaziou.fr> <3295F295-A14A-43EA-8752-53D1BEBCC31A@agrarianresearch.org> <87fuef1fov.fsf@nicolasgoaziou.fr> <829AC437-872D-453D-8543-B3C147F08B54@agrarianresearch.org> <87inj660la.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_853E906E-589F-4880-84A6-7757ABA245B2" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSynp-0008Kw-D1 for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 00:54:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSynm-0000DS-BQ for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 00:54:09 -0400 Received: from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]:34369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSynm-0000Cy-0P for emacs-orgmode@gnu.org; Thu, 06 Jul 2017 00:54:06 -0400 Received: by mail-pg0-x236.google.com with SMTP id t186so5260006pgb.1 for ; Wed, 05 Jul 2017 21:54:04 -0700 (PDT) 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" To: "Charles C. Berry" Cc: org-mode mailing list , Nicolas Goaziou --Apple-Mail=_853E906E-589F-4880-84A6-7757ABA245B2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >>=20 >> "... 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." >=20 > 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. >=20 > So you might want is to use `org-babel-switch-to-session-with-code' = rather than `org-edit-src-code=E2=80=99. 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. > 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. >=20 Yes, that makes sense. Thanks, Vikas --Apple-Mail=_853E906E-589F-4880-84A6-7757ABA245B2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

"... 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=E2=80=99.

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.

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.

Thanks,

Vikas


= --Apple-Mail=_853E906E-589F-4880-84A6-7757ABA245B2--