help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Finding Unused Identifiers


From: August Karlstrom
Subject: Re: Finding Unused Identifiers
Date: Thu, 09 Mar 2006 13:08:46 GMT
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Kevin Rodgers wrote:
August Karlstrom wrote:
 > Thanks Markus for your remarks. When I tested my functions I had
 > previously changed the syntax class for `-' to "w" (word) and then
 > forgot that, so I never noticed the problem. I wonder why the syntax
 > class of dash is not "word" by default in LISP buffers.

Because "-" is a symbol constituent, not a word constituent:

 - Syntax class: word constituent
     "Word constituents" (designated by `w') are parts of normal
     English words and are typically used in variable and command names
     in programs.  All upper- and lower-case letters, and the digits,
     are typically word constituents.

 - Syntax class: symbol constituent
     "Symbol constituents" (designated by `_') are the extra characters
     that are used in variable and command names along with word
     constituents.  For example, the symbol constituents class is used
     in Lisp mode to indicate that certain characters may be part of
     symbol names even though they are not part of English words.
     These characters are `$&*+-_<>'.  In standard C, the only
     non-word-constituent character that is valid in symbols is
     underscore (`_').

OK, thanks for pointing that out. So what is the shortest regular expression to match an identifier containing characters with symbol syntax? Does every such character have to be listed as in e.g.

   \\<[[:word:]_-]+\\>

?


August

--
I am the "ILOVEGNU" signature virus. Just copy me to your
signature.  This email was infected under the terms of the GNU
General Public License.


reply via email to

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