[ESS] proposal re: underscore, part 2

Francois Pepin francois.pepin at sequentainc.com
Mon Apr 9 23:45:14 CEST 2012


Hi Matt,

The main problem I see with that suggestion is that it requires an extra keystroke where none was required before.

It's not a big deal, but the reason why I like the current default is that it saves me keystroke and brain power. For me, that wouldn't be much better than just typing <- manually (which I need to do anyway when I'm using R without ESS).

François


On Apr 9, 2012, at 13:26 , Matthew Fidler wrote:

> Sorry; I'm a little late, but my opinion is to make the underscore
> smarter.
> 
> https://github.com/mlf176f2/ess-smart-underscore.el/blob/master/ess-smart-underscore.el
> 
> Instead of using a space after the underscore, a space before the
> underscore could be used for assignment.  For instance
> 
> foo _
> 
> would produce
> 
> foo <-
> 
> Where as
> 
> foo_ _
> 
> would produce
> 
> foo_ <-
> 
> could produce foo <-.  This should not snag any legal identifiers.
> 
> This and other cases are taken care of by my smarter underscore key.
> 
> 
> 
> Matt.
> 
> On Mon, Apr 9, 2012 at 10:11 AM, Jack Tanner <ihok at hotmail.com> wrote:
> 
>> Following up on whether to leave the underscore situation
>> unchanged, I tallied up the mailing list responses (bottom of
>> this message). Please pardon me if I misinterpreted anyone's
>> thoughts.
>> 
>> People seemed to rally around the compromise to create a new
>> option to bind "<-" insertion to another key. This would satisfy
>> my original request with respect to editing R buffers, but it
>> would not help with editing BUGS / JAGS code, and it would not
>> help ESS novices. If I could rebind smart-underscore and if it
>> could be disabled for BUGS / JAGS altogether, that would help me,
>> at least.
>> 
>> Parenthetically, I agree that "<-" is the preferred style of
>> writing assignment in R, and I use it in my own code. But I
>> disagree that smart-underscore is a good way of teaching that.
>> 
>> Henning Redestig points out that pasting code containing true
>> underscores into an ESS R buffer with smart-underscore enabled
>> will mess up the code. That seems like a serious bug, but it
>> could perhaps be decoupled from this issue. Henning suggests to
>> activate smart-underscore only if an underscore is followed by a
>> space. This change would trigger the pasting bug less often than
>> the status quo, but it will still snag legal identifiers such
>> as "foo_".
>> 
>> Here's my tally of the posts on this. Folks that seem to think
>> that the status quo is problematic in some way:
>> 
>> Vitalie Spinu
>> Henning Redestig
>> Chris Evans
>> Jack Tanner
>> 
>> Folks that are OK with the status quo, but would accept a new
>> option to bind "<-" insertion to some other key:
>> 
>> Rainer Krug
>> Richard M. Heiberger
>> Joshua Wiley
>> Gerald Jean
>> 
>> Folks that would rather see no changes:
>> 
>> Brendan Halpin
>> Rodney Sparapani
>> Tim Hesterberg
>> Martin Maechler
>> 
>> ______________________________________________
>> 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



More information about the ESS-help mailing list