[ESS] Yet another indentation question: indentation after parenthese

Mathieu Basille basille at ase-research.org
Fri Dec 16 21:41:32 CET 2011

Le 16/12/2011 14:54, Rodney Sparapani a écrit :
> Mathieu Basille wrote:
>> Alright, I think I start to understand the problem, and what seemed easy to
>> me might not be possible. I thought that taking parentheses into account
>> would be easier than ignoring them, thus my question!
>> I will stick to 'C++' or 'RRR' styles and manually adjust them when needed
>> (using e.g. 'source' with 'options(keep.source = FALSE)'). This makes,
>> however, the use of 'auto-fill-mode' virtually impossible to me, because
>> such statements:
>> toto <- someFunction(arg1 = bli, arg2 = bla, arg3 = blo, arg2 = c("a",
>> "bla", c(1, 2, 3, 4), "blo", "blu", "bli"))
>> will render awfully with a column width of 70. I can live with this (well,
>> I did for many years now!), I just hoped that there was a way to follow
>> what R uses internally to format R code. I find it a pity that such a great
>> editor like Emacs (which is, by far, the best tool I tried to edit R/Rnw
>> scripts, with the result that I couldn't work without it now) can't
>> reproduce R behaviour.
>> Vitalie and Richard, many thanks go to you for your efforts to 1)
>> understand (!) and 2) trying to find a solution to my little problems!
>> All the best,
>> Mathieu.
> Hi Mathieu:
> Making it into a style might be a challenge.  Mode grammar/syntax is not
> much fun to play with.  Look at the definition of parentheses to see if
> they are a word or punctuation.  Otherwise, you could probably create an
> elisp function that calls R to replace a function with its re-formmatted
> equivalent.  ESS has several functions that work like that.  For example,
> take a look at ess-ebcdic-to-ascii-search-and-replace which replaces EBCDIC
> passages in the buffer with their ASCII equivalents. You might also be able
> to use ESS primitives that find the function definitions and repeatedly
> replace them (just like you can search and replace multiple EBCDIC blurbs
> in one go).
> Rodney

Dear Rodney,

That looks interesting! I have no knowledge of elisp and probably not much
time to dig into it, but I'll keep this on my todo list, in case I find
time for it! An interactive function could actually be quite useful...


> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help


~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.

More information about the ESS-help mailing list