emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mikhail Titov <mlt@gmx.us>
To: Eric Schulte <eric.schulte@gmx.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel, ess] How can I make S-RET to be multi-session friendly?
Date: Fri, 10 Aug 2012 13:54:04 -0500	[thread overview]
Message-ID: <9q0sjbuvar7.fsf@gmx.us> (raw)
In-Reply-To: <87boiidil2.fsf@gmx.com> (Eric Schulte's message of "Fri, 10 Aug 2012 06:42:17 -0600")

Eric Schulte <eric.schulte@gmx.com> writes:

>> There is a wonderful post[1] on how to make S-RET to do handy things in
>> ESS mode. However I often find myself working on several Org documents
>> from different folders.
>>
>> It is quite inconvenient to change a directory in =*R*= buffer each
>> time I work on different document.
>>
>> Is there a neat way to somehow reuse Org mode property =session= that I
>> set buffer wide?
>>
>
> I'm not sure what you mean by "reuse".  All of the information for how
> to set header arguments in available at (info "(org) Using header
> arguments")

Here is the outline of what I have and what I'm doing.

As I mentioned I set default :session header for R to *R*. In my file I have
something like

#+PROPERTY: session *Rreport*

Whenever I C-c C-c on code block, I can see that *R* buffer
was created instead of *Rreport* !

Now, if I edit my code block with C-c ' and hit S-RET on any line, it
evaluates in *R* whereas I'd prefer it to be *Rreport* somehow. I
understand that I'm trying to somewhat mix ob with plain
ESS. Nevertheless I wonder if it is somehow possible.

>> Also for some reason
>>
>> #+PROPERTY: session *Rsomename*
>>
>> does not override session name set in
>> =org-babel-default-header-args:R= even after =C-c C-c= on it when I
>> re-evaluate babel code block with =C-c C-c= on code block, while
>> explicit block header =:session *Rsomename*= makes difference.
>>
>
> Yes, the order of precedence is
>
> system-level < buffer/subtree-level < language-level <
> code-block-level

Then I'd say buffer level does NOT override system-level for some
reason. I just re-built Emacs from bzr to make sure I'm running somewhat
recent Org.

Another weird thing is that when I tried to use Org from git (and not
the stock one), Emacs freezes deadly on
(org-clock-persistence-insinuate) unless I kill ntvdm.exe with Task
Manager (I'm on Windows). But I guess it is a separate story.

>> ,----[ snippet from dot emacs ]
>> | (setq org-babel-default-header-args:R
>> |       '((:results . "output") (:session . "*R*")))
>> `----
>>
>
> Given that (:session . "*R*") will be used by default you could simply
> remove it from your custom setting for org-babel-default-header-args.

This made a trick. Now indeed I have *Rreport* after C-c C-c on code
block. However after C-c ' whenever I attempt to S-RET, yet another *R*
is launched every time instead of evaluating a line.

So the question perhaps is:

How to alter [1] such that when I edit code block with C-c ' , S-RET
executes lines in a proper session. I believe all information is in
there, I just have no clue how would I extract it, e.g. to which main
buffer that code editing buffer (I don't know the right name for it)
belongs to, and what session header is set to in that buffer.

If there is a way to fetch those, perhaps I'd be able to alter original
set up in [1].

>> Footnotes: 
>> [1]
>> http://www.kieranhealy.org/blog/archives/2009/10/12/make-shift-enter-do-a-lot-in-ess/

-- 
Mikhail

  reply	other threads:[~2012-08-10 19:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 18:44 [babel, ess] How can I make S-RET to be multi-session friendly? Mikhail Titov
2012-08-09 19:33 ` Achim Gratz
2012-08-10 12:42 ` Eric Schulte
2012-08-10 18:54   ` Mikhail Titov [this message]
2012-08-11  3:37     ` Eric Schulte
2012-08-11 14:33       ` Andrew Young
2012-08-14 13:17         ` Eric Schulte
2012-08-14 21:48           ` Mikhail Titov
2012-08-14 21:59             ` Bastien
2012-08-16 21:06               ` Mikhail Titov
2012-08-17 14:29                 ` Eric Schulte
2012-08-23 22:11                   ` Mikhail Titov

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=9q0sjbuvar7.fsf@gmx.us \
    --to=mlt@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.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).