[ESS] proposal re: underscore

Chris Evans chrishold at psyctc.org
Thu Apr 5 00:42:16 CEST 2012


I love ESS and R and have used the combination in Linux and Windoze for 
years.  I am so grateful to all who have made both programs (and Emacs 
and Xemacs underneath, I've used both, currently only Emacs).

So I'm not a newcomer but ESS/R probably only accounts for 5% at most of 
my typing and for the other >=95% every time I type an underscore I mean 
and get an underscore and my rattling fingers rattle on.  In ESS the 
smart underscore continues to trip me up every time I've got underscores 
in file names and the like.  It literally trips me: I type a stream of 
keystrokes and realise I got something I didn't intend and backspace 
back and fix it and curse.  I sort of know that there's a parameter 
somewhere that would fix this and that I could reset it but I don't have 
a parameter resetting relationship with ESS, just a mostly loving "out 
of the box" one.

Over the years I hope many new R/ESS users will come to ESS and I think 
they'll all find it baffling.  I didn't know that the underscore as an 
assign had gone from R and have used R for long enough to have read 
things that talked about its availability but I'd vote for the proposed 
change.

Tangentially: we seem to be seeing an exciting phase of a lot of work on 
ESS that introduces many new options or makes people like myself aware 
of new and old options.  I wonder if it's time that one of you 
programming stars to whom I'm so indebted might think about having an 
(optional) installation option check.  R has a very simple one at least 
when installing on windoze (can't remember if it goes through that when 
I first installed on Debian or with upgrades, deferring latest upgrade 
as I'm on leave and on expensive 3G line).

I suspect this isn't easy to do but I don't understand the code here at 
all.  If it could be done it might allow a choice between "legacy 
settings" and "newcomer settings" as well as the option to drill into 
more detailed choices.

Just my 2p (2c?),

Chris

Richard M. Heiberger sent the following  at 04/04/12 22:42:
> A new option to assign "<- " to some other key is fine.
>
> The present behavior should not be changed.
> The default in S and R modes should be ess-smart-underscore and the
> ess-toggle-underscore must continue to work for people whose .emacs
> currently
> want it off.
>
> On Wed, Apr 4, 2012 at 4:28 PM, Vitalie Spinu<spinuvit at gmail.com>  wrote:
>
>>
>> Hi,
>>
>> I tend to agree with Jack, it's inconsistent across the modes. And
>> unless you are using ESS only for R, it's a problem. This is why I am
>> not using it myself. In any case I think smart-underscore should be
>> smart-assignment instead, with an ability to be assigned it to any
>> key. Once assigner to a key "x", pressing "x" twice should do whatever
>> action was hijacked. I would probably like to assign it to "<". Jack's
>> C-= idea is not bad ad all as that key is free, easy to type, and has
>> intuitive meaning.
>>
>> What others think? May be we should put it to a vote.
>>
>> Vitalie.
>>
>>>>>> Rainer M Krug<r.m.krug at gmail.com>
>>   >>>>  on Wed, 4 Apr 2012 20:12:00 +0200 wrote:
>>
>>   >  Hi
>>
>>   >  On 04/04/12 19:52, Jack Tanner wrote:
>>   >>  Premise: the smart-underscore behavior in ESS is problematic because
>>
>>   >  I would not agree here.
>>
>>   >>
>>   >>  1) it's inconsistent across modes, as described in my post a couple of
>> weeks ago and repeated
>>   >>  below for convenience
>>
>>   >  OK - I can not comment to bugs-mode as I have never used bugs, but it
>> is consistent in R modes.
>>
>>   >>
>>   >>  2) it's confusing to novices, as evidenced by the fact that it's a FAQ
>>
>>   >  Well - there are many "problematic" things to remember for a novice -
>> underscore as a very
>>   >  convenient one is probably a minor issue.
>>
>>   >>
>>   >>  3) it will be even more confusing to novices over time, because
>> underscore as assignment
>>   >>  operator was phased out in R a long time ago
>>
>>   >  Sorry - I never heard about "underscore as assignment operator" in R.
>> It must have been a long
>>   >  time ago.
>>
>>   >>
>>   >>  4) it requires two keystrokes of underscore to get an actual underscore
>>
>>   >  True - but only one to get "<-" ...
>>
>>   >>
>>   >>  Proposal: ESS should emulate another R editor on this point, namely
>> StatET. The
>>
>>   >  Well - ESS runs in emacs, and emacs has different shortcuts then the
>> other editors - but I see you
>>   >  point here.
>>
>>   >>  behavior is as follows:
>>   >>
>>   >>  1) typing = gets you =
>>   >>
>>   >>  2) typing _ gets you _
>>   >>
>>   >>  3) typing<- gets you<-
>>   >>
>>   >>  4) (this is the magic one) typing Ctrl+= gets you<-
>>   >>
>>   >>  The main argument 'pro' is that 1-3 are not at all confusing to
>> novices, and 4 is a
>>   >>  discoverable feature, i.e., a reward for advanced users. Additionally,
>> this would be consistent
>>   >>  across S, R, BUGS, and JAGS, and would not violate their syntax,
>> unlike the current behavior
>>   >>  (explained in my older note, below).
>>   >>
>>   >>  The current smart-underscore could be retained as-is for those who
>> want it but turned off by
>>   >>  default in future versions.
>>
>>   >  As long as the default behaviour stays as it is, it would be OK.
>>
>>   >  I actually see the "_ as<-" as a huge plus of ESS.
>>
>>   >  Cheers,
>>
>>   >  Rainer
>>
>>   >>
>>   >>  -- my older email, repeated for reference --
>>   >>
>>   >>  1. In ESS[BUGS] mode, underscore is bound to ess-bugs-hot-arrow, which
>> is definitely wrong,
>>   >>  because it doesn't let me create variables like foo_bar.
>>   >>
>>   >>  2. I'd like it if I could use smart-underscore as in ESS[S] mode, but
>> if I do
>>   >>
>>   >>  (define-key ess-bugs-mode-map (kbd "_") 'ess-smart-underscore)
>>   >>
>>   >>  then there's no smart-underscore behavior, just a plain underscore.
>>   >>
>>   >>  ______________________________________________ ESS-help at r-project.orgmailing list
>>   >>  https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>> ______________________________________________
>> ESS-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>
>


-- 
Chris Evans <chris at psyctc.org> Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions    *
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:       chris dot evans at nottshc dot nhs dot uk
and to:                     c dot evans at nottingham dot ac dot uk



More information about the ESS-help mailing list