From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel, ess] How can I make S-RET to be multi-session friendly? Date: Fri, 10 Aug 2012 21:37:03 -0600 Message-ID: <87a9y214m8.fsf@gmx.com> References: <9q01ujfoqh2.fsf@gmx.us> <87boiidil2.fsf@gmx.com> <9q0sjbuvar7.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T02W4-0007Me-Sr for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 23:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T02W3-0006Es-G4 for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 23:37:32 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:44778 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T02W3-0006Em-9r for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 23:37:31 -0400 In-Reply-To: <9q0sjbuvar7.fsf@gmx.us> (Mikhail Titov's message of "Fri, 10 Aug 2012 13:54:04 -0500") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mikhail Titov Cc: emacs-orgmode@gnu.org >> >> 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 believe you mean the buffer-level does not override the language-level. > 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. > I have no idea what could be causing the above, but it seems unrelated. > >>> ,----[ 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]. > You can find the name of the original org-mode buffer by running the following snippet of elisp within the edit buffer. ;; -*- emacs-lisp -*- (marker-buffer org-edit-src-beg-marker) The `org-src-in-org-buffer' macro may be used from an edit buffer to run elisp inside the code block, in the org-mode buffer of the edit buffer. e.g., the following ;; -*- emacs-lisp -*- (org-src-in-org-buffer (message "-->%S" (org-babel-get-src-block-info))) Best, > >>> Footnotes: >>> [1] >>> http://www.kieranhealy.org/blog/archives/2009/10/12/make-shift-enter-do-a-lot-in-ess/ -- Eric Schulte http://cs.unm.edu/~eschulte