emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?


From: Mikhail Titov
Subject: Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?
Date: Thu, 16 Aug 2012 16:06:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (windows-nt)

Bastien <address@hidden> 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 <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]