[ESS] Can smart underscore work the other way around?

Greg Snow 538280 at gmail.com
Fri Mar 7 20:04:16 CET 2014


> library(fortunes)
> fortune('<<-')

I wish <<- had never been invented, as it makes an esoteric and dangerous
feature of the language *seem* normal and reasonable. If you want to dumb down
R/S into a macro language, this is the operator for you.
   -- Bill Venables
      R-help (July 2001)

So, it could be argued that a binding that made it impossible (or at
least difficult) to type "<<-" would be a good feature.

On Fri, Mar 7, 2014 at 5:18 AM, Henning Redestig <henning.red at gmail.com> wrote:
> switching to another character is already possible by defining
> ess-smart-S-assign-key. I have it bound to < but is not optimal as I see
> code from colleagues who copied my configuration have lots of "  <- "
> instead of intended " <- " in their code (two spaces instead of one). I
> didn't come up with a good way to fix that. Having the assignment appearing
> after double press is nice but gets difficult to type the character twice
> then no? Like in with my binding, how would I then write <<- ?
>
>
> 2014-03-06 19:02 GMT+01:00 Vitalie Spinu <spinuvit at gmail.com>:
>
>>
>> Would be nice to have a generic function that would take a sequence of
>> possible "outputs" (like "_", " <- ") and then insert them in turn on
>> the same key press. Then people can reuse it for other smart operators.
>>
>>   Vitalie
>>
>>
>>
>>  >>> "Richard M. Heiberger" on Thu, 6 Mar 2014 12:52:46 -0500 wrote:
>>
>>  > Here is my outline.
>>  > Duplicate the current code with reversed positions.
>>  > Have a new customized variable ess-smart-underscore-sequence which
>>  > can take values 'assign and 'character.
>>
>>  > Rich
>>
>>  > On Thu, Mar 6, 2014 at 12:45 PM, Vitalie Spinu <spinuvit at gmail.com>
>> wrote:
>>  >>
>>  >> This is actually a very good idea, and quite frankly a natural way to
>>  >> think about it. Proposals for the code are very much welcome.
>>  >>
>>  >> Vitalie
>>  >>
>>  >> >>> Henric Winell on Thu, 6 Mar 2014 11:49:30 +0100 wrote:
>>  >>
>>  >> > Hi,
>>  >>
>>  >> > As much as I love the smart underscore for S, it would be great if
>> it could work
>>  >> > the other way around.  That is, pushing '_' once results in '_' and
>> twice
>>  >> > results in '<-'.  Is it possible?  Or is it something for the
>> wishlist, perhaps?
>>  >>
>>  >> > Since objects in R nowadays can have names including '_' I find
>> myself pushing
>>  >> > _' twice very often.
>>  >>
>>  >> > Best regards,
>>  >> > Henric Winell
>>  >>
>>  >> > ______________________________________________
>>  >> > ESS-help at r-project.org mailing 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
>>
>> ______________________________________________
>> 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



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



More information about the ESS-help mailing list