[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[1]: words, symbols and syntax-tables
From: |
Eric M. Ludlam |
Subject: |
Re[1]: words, symbols and syntax-tables |
Date: |
Tue, 10 Jul 2001 17:04:21 -0400 |
>>> "Stefan Monnier" <monnier+gnu/address@hidden> seems to think that:
>
>Why on earth is there such a thing as a "w" syntax-class ?
>It seems the distinction between "w" and "_" is only used for
>interactive `forward-word' operations and that in such cases
>the definition of what is a "word" does not really depend on
>the major-mode but is instead pretty much "constant".
>
>I.e. why not eliminate the "w" syntax-class and implement forward-word
>using something else than the buffer's syntax-table (like a global
>"word-char-table" similar to the case-tables) ?
>
>Obviously, this would break lots of code in various ways, but
>in hindsight, was it a good decision to implement word-operations
>using syntax-tables (and more specifically the "w" syntax-class) ?
[ ... ]
I was recently thinking it would be useful to add a new type of
syntax augmentation for numbers. Using the existing "w" class
which has recently caused offense:
char syntax
?a -> "w" - a boring word char
?1 -> "w#" - a number word char
?, -> "." - a boring punctuation
?. -> ".#" - a number oriented punctuation
where # works like paren matching, or comment numbers.
Now `delete-sexp' has a chance of slurping floating point numbers.
Perhaps the "_" is a special augmentation of "w", or vice versa.
My universal preference would be to replace syntax tables with the
same style of power found in lex, but that's just because I'm writing
parsers.
Eric
--
Eric Ludlam: address@hidden, address@hidden
Home: www.ultranet.com/~zappo Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: www.gnu.org