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 (`_').