[ESS] proposal re: underscore, part 2

Vitalie Spinu spinuvit at gmail.com
Mon Apr 9 19:24:36 CEST 2012


It's a pity we cannot have non-ess users opinion here:)

>From the next version of ESS you will get smart SPC which will correct
whatever mess is before the cursor and also indent:

"foo_"  into "foo <- "
"foo="  into "foo = "
"foo<-" into "foo <- "

and so on. Of course fully customized. 

Originally I was thinking to implement a full set of smart operators,
but following Henning's suggestion it appeared to me that a very smart
SPACE should be pretty much enough for everything. It's also easier to
customize and considerably less intrusive.


>>>> Jack Tanner <ihok at hotmail.com>
>>>> on Mon, 9 Apr 2012 15:11:40 +0000 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

More information about the ESS-help mailing list