From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikhail Titov Subject: Re: [babel, ess] How can I make S-RET to be multi-session friendly? Date: Thu, 16 Aug 2012 16:06:36 -0500 Message-ID: <9q0fw7m7dib.fsf@gmx.us> References: <9q01ujfoqh2.fsf@gmx.us> <87boiidil2.fsf@gmx.com> <9q0sjbuvar7.fsf@gmx.us> <87a9y214m8.fsf@gmx.com> <87y5lh6291.fsf@gmx.com> <9q0a9xxrvp7.fsf@gmx.us> <878vdhyw27.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T27HE-0004P3-9Y for emacs-orgmode@gnu.org; Thu, 16 Aug 2012 17:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T27HC-0005ko-Lz for emacs-orgmode@gnu.org; Thu, 16 Aug 2012 17:06:48 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:56253) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T27HC-0005kQ-Fg for emacs-orgmode@gnu.org; Thu, 16 Aug 2012 17:06:46 -0400 In-Reply-To: <878vdhyw27.fsf@gnu.org> (Bastien's message of "Tue, 14 Aug 2012 23:59:12 +0200") 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: Bastien Cc: Andrew Young , emacs-orgmode@gnu.org, Eric Schulte Bastien writes: >> I would say that after applying changes to my-ess-eval and to >> org-babel-edit-prep:R as suggested by Andrew, it looks like everything >> is working right for me. > > I'v been bold and I pushed the change Andrew suggested. > > Thanks for reporting this and for testing around -- and thanks > to Andrew for the exploration and the fix! Though not related to Org, I noticed that ess-make-buffer-current calls (update-ess-process-name-list) thus making a call for it in my-ess-eval, probably, somewhat redundant, right? Another thing that somewhat bugs me is that if R process quits (or probably dies as well) when editing source code block in a separate buffer, the subsequent S-RET will silently execute a line in a wrong buffer/process. If there are no buffers with R process, it will create the default *R* named buffer. It might be exotic but I think it is an issue. Does it mean that there is a bug in ess-make-buffer-current function somewhere? Something, probably, re-associates a buffer to another process, does it? I think it might be relevant that code editing buffer local variable ess-local-process-name is non-nil when associated process quits. This results in first ess-make-buffer-current in my-ess-eval silently launching *R*. I'm not sure if it is too much to fix. Perhaps hitting C-c ' twice to re-start editing is a reasonable workaround. Eric Schulte writes: > 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))) Where is org-src-in-org-buffer macro defined. Searching all dot el files in org folder does not show anything neither does C-h f show anything similar. -- Mikhail