Ah, yes.  Your original response *did* contain the change from "1" to "2,"
but I didn't see it because of the line wrapping.  Sorry I missed that!

I originally constructed the "highlight-argument-names" regexp, specifically
this part

[(,][\n[:blank:]]*

to avoid the highlighting you described, e.g., highlighting the x and y in

x = 1:10
y = rnorm(10)

I think the original regexp should work *in theory*, but there is something
that I don't understand about how Emacs highlights multiline expressions.  I
had originally added

(setq font-lock-multiline t)

to my ess-mode-hook, but that didn't correct the problem in all cases.
 Sometimes it worked and sometimes it didn't.

Anyway, your workaround is very nice and will work for me since I too always
use the "<-" operator for assignment.

Thanks again,

McKay




S. McKay Curtis
Postdoctoral Research Associate
University of Washington
Department of Statistics
Box 354320
Seattle, WA 98195-4320
(206) 543-6851


On Fri, Jul 23, 2010 at 10:10 AM, Steve Lianoglou <
mailinglist.honeypot@gmail.com> wrote:

> On Fri, Jul 23, 2010 at 12:55 PM, S. McKay Curtis
> <smcurtis@stat.washington.edu> wrote:
> > Steve,
> > Fabulous!  Thanks for passing along the tip.  The fact that the first
> > argument name after a line break never highlighted with my old .emacs
> code
> > has been a minor irritant for a few months now.
> > Note, I also had to change the "1" following the regexp to a "2" as in
> >
> ("\\([(,]\\|[\n[:blank:]]*\\)\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*=[^=]"
> > 2 font-lock-reference-face)
>
> Yeah, sorry for not explicitly pointing that out -- it was in my
> original email, but the funny wrapping may not have made it obvious.
>
> There's a down side to this "fix" tho, which is that it will highlight
> the LHS of a statement if you use "=" for assignment, eg:
>
> x = 1:10
> y = 11:20
> z = x + y
>
> The x,y,z on the LHS of those statements all get highlighted. It's not
> a big deal for me since I always use "<-" for assignment in my code,
> but it my annoy others who stumble onto this thread later and try this
> out.
>
> Cheers,
> -steve
>
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
>  | Memorial Sloan-Kettering Cancer Center
>  | Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact
>

	[[alternative HTML version deleted]]

