[ESS] tcsh, bash, and the inferior R process

Erik Iverson iverson at biostat.wisc.edu
Tue Oct 16 00:12:05 CEST 2007


I now see from the ESS manual (Section 4.4.3) that

4.4.3 Re-submitting commands from the transcript

...

When the cursor is not after the current prompt, the <RETURN> key has a 
slightly different behavior than usual. Pressing RET on any line 
containing a command that you entered (i.e. a line beginning with a 
prompt) sends that command to the ESS process once again. If you wish to 
edit the command before executing it, use C-c RET instead; it copies the 
command to the current prompt but does not execute it, allowing you to 
edit it before submitting it.

...

If I interpret the manual correctly, it appears that invoking Xemacs 
under tcsh is actually doing the wrong thing.  Regular Emacs under tcsh 
appears to do the right thing, that is, send the command that point is 
on *and* submit it. Xemacs under tcsh will copy the command to the 
command prompt and leave point at the *beginning* of the command upon 
hitting <RETURN> on a previous command.  C-c <RETURN> copies the command 
to the prompt and puts point at the *end* of the command.

C-c Ret works in Xemacs lauched from bash for me as documented.  I will 
now use C-c <RETURN> to do what I was used to doing, or remap the 
<RETURN> key since I know the elisp function names now.

So the upshot is that I (believe) XEmacs lauched from a tcsh shell is 
actually doing the *wrong* thing, and I had just gotten used to it.

Thanks,
Erik





Kasper Daniel Hansen wrote:
> I have no idea why you observe a difference, but here is waht I see  
> using bash:
> 
> Btw. how do you start Emacs - in a terminal or what?
> 
> On Oct 15, 2007, at 10:34 AM, Erik Iverson wrote:
> 
>> Hello -
>>
>> I have been using the "tcsh" shell under Linux for a while now.   Today,
>> I experimented with changing my default shell to bash.  The  behavior of
>> the inferior R process mode (iESS) in ESS seems to change depending on
>> which shell I'm using, and I can't figure out why.
>>
>> First, my software.  I'm using ESS 5.3.6, R 2.5.1, XEmacs 21.5.24
>> (Beta), all on RHEL4.  I've verified the issue using Emacs also, so
>> XEmacs doesn't seem to be the problem.
>>
>> I am using ypchsh to change my default shell, since we use NIS here.
>>
>> So here is my problem.  I start an inferior R process using M-x R, and
>> issue a command, say
>>
>>> 2 + 2
>>
>> [1] 4
>>
>> Now, if my shell is tcsh, I am able to move point to the line  containing
>> "2 + 2", and hit "Return" to copy "2 + 2" to the inferior R mode's
>> prompt.  I could then edit the command, and hit "Return" again to  submit
>> it.
>>
>> However, after changing my default shell to the bash shell, moving  point
>> to the "2 + 2" line and hitting "Return" copies the "2 + 2" command
>> *and* submits it to the R process, so I see
>>
>>> 2 + 2
>>
>> [1] 4
>>
>> again, with only hitting "Return".  So I seem to have lost my editing
>> capabilities.
> 
> 
> I see this behavior as well. I find it strange that hitting RETURN  
> should copy the line to the prompt line, but perhaps I just haven't  
> been exposed to it.
> 
> 
> 
>> Another issue is that, using tcsh, I am used to hitting C-c C-c to  move
>> point to a command prompt in the iESS buffer.
>>
>> Under bash, C-c C-c seems to do this properly, but it copies whatever
>> line I'm on before doing it.  For example,
>> hitting C-c C-c on the 2 + 2 line, I get
>>
>>> 2 + 2 C-c C-c
>>>
>>
>> So it literally prints 'C-c C-c' in the iESS buffer.  Further, if I  hit
>> C-c C-c on the
>> [1] 4
>> line, the minibuffer says "No command on this line." and point remains
>> on that line.
> 
> 
> I do _not_ see this. C-c C-c just brings me to the prompt no matter  what.
> 
> Kasper
> 
>> If anyone has any idea why changing shells might do this, I'd be  glad to
>> try some things!
>>
>> I do very often submit R code from a source file to the R process, and
>> that still works just fine.  I do prefer that approach, but once in
>> awhile find myself typing something quick in the iESS buffer.  I'm  just
>> curious why the shell might be affecting the bahavior of that buffer.
>> Hopefully this isn't something obvious that I've overlooked.  I've  only
>> tried tcsh and bash, I suppose I could try some more shells and see  what
>> behavior I observe.
>>
>> Thanks,
>> Erik Iverson
>> iverson at biostat.wisc.edu
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
> 
>




More information about the ESS-help mailing list