[ESS] Automatic insertion of space after comma in iESS mode

Vitalie Spinu spinuvit at gmail.com
Mon Jan 23 21:38:01 CET 2012


Aleksandar Blagotić <aca.blagotic at gmail.com> writes:

> That is a nice feature indeed, but I already have all those smart functions
> assigned to custom keybindings. And what keeps me frustrated the most is
> inconsistency. While smart comma "works" in iESS buffer, it does not work
> in R scripts (r-mode), unlike smart assignment string which is kind-of
> global for S/R dialects.
>

Ok, it's fixed now and forever. There is ess-R-smart-operators variable
which can be t to activate the smart-comma (and all other smart
operators to come) in both ESS and iESS. It's nil by default. In the
future it will also allow a list to explicitly enumerate desired smart
operators for the specific mode.

Handy-command invocation on "," immediately after the prompt stays though.


"Richard M. Heiberger" <rmh at temple.edu> writes:
> This suggests another new feature.  We currently have a family of
> indentation functions (indent-region, etc).
> Can you write a new family of ess-smartification functions that will allow
> the user to go back and apply all
> of the new smart key options to  the region?  This I would use.  For
> example, if someone sends to R-help
> a line of the form "y<-abcd(d,e,f,g)", the new capability would convert it
> to
> "y <- abcd(d, e, f, g)"

I think something like that is already in ESS but I cannot find it nor
remember the function.


Your idea suggest yet another new feature. Imagine that not the user,
but Emacs goes back automatically and corrects all the mess. It could be
invoked by SPACE key or it could be triggered by an idle timer.

You type

tf<-foo%in%boo==zoo

and on next SPC it transforms into

tf <- foo %in% boo == zoo

Sounds pretty cool to me - doesn't interfere with the user's habits and
still corrects everything. It's even faster since you don't have to type
spaces :-)

Best,
Vitalie.



More information about the ESS-help mailing list