Hello,

 

I am one of the developers of the "inlinedocs" package, which uses
functions patterned like the following:

 

age_person <- function # make Person older

### Increment Person's age

(this,                 ##<< R.oo object of class Person

years,                ##<< how many years to add

...)                  ##<< ignored here

{

  paste(this$.name, "was", as.integer(this$.age), "years old.");

}

 

However the comments between the function keyword and the opening
parenthesis do not match ess-function-pattern. I realise that it is
already an extremely complicated regexp, but after a bit of tweaking I
found that the following change (which also allows the function argument
list opening parenthesis to be on a new line without any intervening
comments) appears to work: replace the trailing "function\\s-*(" with
"function\\s-*\\(?:\\(?:#.*\\)?\n\\s-*\\)*(". This modification can be
done locally in any number of ways (emacs file-local variables,
directory-local variables, ess-mode-hook etc.), but I wonder whether I
could propose the above as a modification to ESS?

 

Thankyou,

 

Keith Ponting

Aurix Ltd, Malvern WR14 3SZ  UK

 


	[[alternative HTML version deleted]]

