Ar an séiú lá de mí Bealtaine, scríobh Stephen J. Turnbull:
Aidan Kehoe writes:
> +It is also possible to specify named character classes as part of your
> +character set; for example, @samp{[:xdigit:]} will match hexadecimal
> +digits, @samp{[:nonascii:]} will match characters outside the basic
> +ASCII set. These are documented elsewhere, @pxref{Char Classes}.
I think this documentation should mention the (obvious) way to specify
character sets like "[:alnum" (ie, ":]alnum").
Go for it.
Also, is "[:alnum" a valid character set or a syntax error?
I think it
probably should be the latter.
It’s the former, which is what GNU does too. It would be reasonable and
compatible to add compile-time warnings to point out that the user has
probably mistyped things.
> + /* XEmacs; we need this, because we unify treatment of ASCII
and non-ASCII
> + (possible matches) in charset_mule. [:alpha:] matches all characters
> + with word syntax, with the exception of [0-9]. We don't need
> + BIT_MULTIBYTE. */
Is this really a good idea? In particular, do grep and Emacs agree
with this definition of "[:alpha:]"? (The man page for grep on Mac OS
X suggests that it only includes ASCII characters.)
grep has no understanding of XEmacs character syntax. GNU Emacs [:alpha:]
matches any non-ASCII character with word syntax, and the ASCII characters
[a-zA-Z] . My comment is a little inaccurate, in that what has word syntax
varies with mode, and our behaviour is actually closer to what GNU does than
to what I say.
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches