Kasper,

I think ess-remote is a very valuable alternative. However, as you point
out, you run R in an Emacs shell not an Emacs process (not sure I am using
the right terminology here). So when you ask for help under R as in

>?plot

The Emacs shell tries to display the help in the buffer using more as pager
(bad combination). In addition, you don¹t get all the other benefits of
using R in emacs, like auto-completion, the help at point (C-c C-v), etc...

With our clusters, we run an X11 emacs instance (an emacs process) that runs
on the cluster but the display is sent to the X11 server that you are
running on your desktop or laptop. Thus, the emacs instance that you are
running is actually on the cluster but you interact with the cluster through
your local X11 server (hope that make sense). So when you start an R session
by M-x R you actually runs a R process locally on the cluster through an
Emacs process that run on the cluster but the windowing is channel to your
desktop machine running the remote X11 server (It¹s kinda the opposite of
what happen normally with sever/client interaction). At the end of the day,
it¹s exactly (truly exactly) as running R under Emacs on your machine

It makes life real real easy, you should give it a try. The only downside is
that it requires a very good internet connection as all the windowing
information has to be transfer from the machine running the X11 emacs to
your machine running the X11 server. When your desktop and the cluster are
on the same network running gigabit ethernet, you won¹t even realize that
there is a lot of traffic going on. However, it is unbearable if ran through
a bad or lowspeed ISP.

Cheers,

Marco


On 11/29/07 9:58 AM, "Kasper Daniel Hansen" <[EMAIL PROTECTED]>
wrote:

> 
> 
> On Nov 28, 2007 5:58 PM, Marco Blanchette <[EMAIL PROTECTED]> wrote:
>> Hi Kasper,
>> 
>> You read my mind! Yes, I am trying to run and R session on a mac workstation
>> in my office from my mac laptop at home (and has you probably guessed, this
>> is to analyze microarrays from home).
> 
> This is somewhat easy to fix. You have probably set your display variable in
> Terminal, so you get something like this (from Terminal):
> 
> (local terminal)# echo $DISPLAY
> : 0.0
> 
> When you then ssh into your server, you get something like
> (remote terminal)# echo $DISPLAY
> localhost:10.0
> 
> (you may have to enable X11 forwarding by doing "ssh -X")
> 
> Now, what have all this to do with Emacs and so on. Well, the thing is that
> when you start a shell inside Emacs it does not automatically read the
> initialization files you have in terminal. So when I do (now inside Emacs)
> M-x shell
> (emacs shell)# echo $DISPLAY
> 
> I get nothing! Because I have set my DISPLAY variable in ~/.profile. Now, you
> can fix this temporarily by doing
> (emacs shell)# export DISPLAY=:0.0
> (emacs shell)# ssh -X SERVERNAME
> you can now check whether DISPLAY has been set on your remote server by
> (emacs shell, now on remote server)# echo $DISPLAY
> If this works, you just start R as usual, by doing
> (emacs shell)# R
> 
> Now all you have is R running inside a shell inside Emacs. Emacs does not now
> that you are in fact running R... Here the magic comes in. When you are in the
> "shell running R" buffer, you just do
> M-x ess-remote
> and press RETURN when it asks for the dialect. Now, Emacs is aware that this
> is an R buffer (see the change in modeline), and you can work with it as you
> work with a normal R buffer using ESS.
> 
> It is almost as good as a normal R buffer, except that 1) I have problems with
> the help system and 2) C-c C-c not only stops the R evaluator, it actually
> kils the ssh process and dumps R, meaning it is effectively impossible to
> interrupt. 2) is pretty irritating...
> 
> Now, I forgot how to set this DISPLAY variable so that Emacs reads it
> automatically, someone else may have an idea of that.
> 
> Is this what you do when you say you run it remotely on the Unix cluster from
> your X11 instance?
> 
> Kasper
> 
>  
>> 
>> I could do what you suggested, the only problem is that you can't channel
>> plots generated from the remote computer on your local machine (well, I
>> can't!). While, if you run an emacs session from a local X11 server (my Mac
>> laptop) and inititate and R process on the remote machine (onto my mac
>> workstation in my lab), it's exactly like working directly on the
>> workstation. We have several Unix clusters and this is how we interact with
>> them. 
>> 
>> So, I did compile a X11 version of Gnu emacs [following these recomandation
>> http://www.oreillynet.com/mac/blog/2006/01/building_emacs22_on_mac_os_x.html]
>> <http://www.oreillynet.com/mac/blog/2006/01/building_emacs22_on_mac_os_x.html
>> %5D>  and I can channel it through my internet connection from X11. It's
>> pretty fast and seems to be pretty stable (so far) and as I said it's
>> [almost] exactly like working with Carbon Emacs on the workstation (I can't
>> get my alt key remapped to meta-).
>> 
>> For you guys wondering how to channel X11 applications from a local Mac (can
>> be a Mac but it can be any machine running an X11 server) to your remote Mac
>> here is a couple of very informative links:
>> http://developer.apple.com/opensource/tools/runningx11.html
>> http://developer.apple.com/qa/qa2004/qa1383.html
>> 
>> Thanks guys and sorry for the out of subject post.
>> 
>> Marco
>> 
>> 
>> 
>> On 11/28/07 12:17 PM, "Kasper Daniel Hansen" <[EMAIL PROTECTED]>
>> wrote:
>> 
>>> Marco: depending on what you want to do, there may be other ways to do it.
>>> If you want to run R for example, there is a "ess-remote_ command that
>>> allows you to use a remote server for the R process while still keeping
>>> everything in your local Emacs. You can also do a
>>>   M-x shell
>>> that opens up a shell within emacs, then ssh from that shell into your
>>> server and now you have a shell access within Emacs. This is essentially
>>> what ess-remote mentioned above does for R - depending on what you are doing
>>> there may be a similar solution.
>>> 
>>> Having said all of that, sometimes you just want to open e remote Emacs
>>> session.
>>> 
>>> I would suggest perhaps giving us a detailed description of what you are
>>> trying to accomplish.
>>> 
>>> Kasper
>>> 
>>> On Nov 28, 2007 10:04 AM, David Reitter <[EMAIL PROTECTED]> wrote:
>>>> 
>>>> On 28 Nov 2007, at 17:58, Marco Blanchette wrote:
>>>>> >
>>>>> > An obvious typo... I meant to write running processes from my laptop
>>>>> > on my
>>>>> > workstation under emacs... I would prefer not to use window server
>>>>> > as they
>>>>> > are typically very slow to respond and not friendly at all.
>>>> 
>>>> So you want to run Emacs as a process on one machine, but use it from
>>>> the other, right?
>>>> And the typo was (excuse me if I'm being ignorant, it's not obvious to
>>>> me) that one of the machines is not a Mac?
>>>> 
>>>>> > A colleague of mine sent me the following link to build an X11 emacs:
>>>>> > 
>>>>> 
http://www.oreillynet.com/mac/blog/2006/01/building_emacs22_on_mac_os_x.ht>>>>>
ml
>>>> 
>>>> 
>>>> Sure, that would work - even though it wouldn't be Carbon Emacs and
>>>> you would again be using a window server remotely ( i.e. X11) -- which
>>>> isn't that slow after all, over a local connection.
>>>> 
>>>> Your other message, about the large files, made it clear to me. X11 or
>>>> the Terminal are your best bet.
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> 



-- 
Marco Blanchette, Ph.D.
Assistant Investigator
Stowers Institute for Medical Research
1000 East 50th St.

Kansas City, MO 64110

Tel:  816-926-4071
Cell: 816-726-8419
Fax: 816-926-2018 


--~--~---------~--~----~------------~-------~--~----~
"Carbon Emacs" group mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/carbon-emacs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to