[ESS] proposal re: underscore

Rainer M Krug r.m.krug at gmail.com
Wed Apr 4 20:12:00 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/ess-help


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk98jvAACgkQoYgNqgF2egod0wCfUANhvVxeI5b3xaLBG79GT/3s
D44An02AwcpA6ScyOIu5LfG8CtNOBpYB
=dj1m
-----END PGP SIGNATURE-----



More information about the ESS-help mailing list