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: Tue, 14 Aug 2012 16:48:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (windows-nt)

Eric Schulte <address@hidden> writes:

> Thanks for sending this along, unfortunately ob-R.el is currently
> without a core maintainer

Quite a sad situation, many good modules lack maintainers :(

>, so I'm not sure who on list would have the expertise to review your
>submission.  Although hopefully those experiencing the problem can at
>least check if it works for them.

I'm not an expert but I gave it a shot.

>> It seems that for me, the inferior ess process is not being properly
>> associated with the src edit buffer.  It is being set correctly by
>> org-babel-R-associate-session, and then being set a second time
>> incorrectly by org-babel-edit-prep:R.  Commenting out line 5 in
>> org-babel-edit-prep:R seems to fix this issue, although I'm honestly
>> not sure if or what it breaks.  Everything seems ok for me, but ymmv.
>>
>> Heres the change:
>> #+begin_src emacs-lisp
>>   (defun org-babel-edit-prep:R (info)
>>     (let ((session (cdr (assoc :session (nth 2 info)))))
>>       (when (and session (string-match "^\\*\\(.+?\\)\\*$" session))
>>         (save-match-data (org-babel-R-initiate-session session nil))
>>         ;;(setq ess-local-process-name (match-string 1 session)))))
>>         )))
>> #+end_src
>>
>
> Perhaps replacing the commented "setq ess-local-process-name" line with
> ess-switch-process could solve this problem?  Could the process name be
> found programatically, perhaps using the regexp solution above.
>
>>
>> Is there any one having such issues, or who can weigh in on what
>> exactly is happening here?
>>
>> Without making the above change, it is possible to manually attach an
>> ess process to the current src buffer by using the command:
>>
>> C-c C-s (ess-switch-process)
>>
>> You'll have to specify the process name, rather than the buffer name,
>> and the session must have already been started.

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. Once I hit C-c ' I see properly named buffer
appear with new process. Then if I hit S-RET it asks me what session to
use and since I have ido mode, it already highlights proper session
name, so I just hit RET. Perhaps it worth recommending to use ido?

Note that I do not have to enter process name.

If I quite R, while editing code in a separate buffer, and hit S-RET it
is executed in the wrong one without any question being asked :(

I'm running somewhat recent bzr version of Emacs with default Org in it.

-- 
Mikhail



reply via email to

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