emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perl-mode "::" as word character [patch]


From: Stefan Monnier
Subject: Re: perl-mode "::" as word character [patch]
Date: Thu, 05 May 2005 23:02:20 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> Word syntax is clearly wrong.  Symbol syntax (i.e. "_") OTOH sounds right.
> I would be happy to agree.  But \\s_ doesn't seem to match anything, and

It matches any char marked with the _ syntax, which is the syntax to use for
chars which are not word-chars but are allowed as part of symbols.

> \\sw doesn't match anything designated as ("\\(::\\)" (1 "_")).

Of course not.  To match a symbol try "\\(\\sw\\|\\s_)+".

> It only matches "w".  Word syntax may be "wrong" for English, but in perl
> ':' is equivalent to A or q or whatever.

No, it's not the same thing.  Emacs distinguishes words from symbols and
it's quite handy sometimes.

> I'll go with the precedent, but if it's better without, you can remove
> both the 'starting-with-&' and the 'followed-by-a-(' expressions.
> They're both pretty equivocably defined as function calls, not function
> definitions, in perl.

Agreed.

> "\\(?:\\<foreach\\>\\|\\<for\\>\\)\\s *\\(\\sw+\\)\\s *(" and... then
> how to make that /not/ highlighted, while every other
> "\\(\\sw+\\)\\s *(" gets highlighted as a function call?

Aren't there more cases? like

       print HANDLE (arg1, arg2) ?

>> Could you (re)send a context diff rather than plain diff?
> Um, sure.

Thank you.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]