annotate src/s/bsd-common.h @ 5648:3f4a234f4672

Support non-ASCII correctly in character classes, test this. src/ChangeLog addition: 2012-04-21 Aidan Kehoe <kehoea@parhasard.net> Support non-ASCII correctly in character classes ([:alnum:] and friends). * regex.c: * regex.c (ISBLANK, ISUNIBYTE): New. Make these and friends independent of the locale, since we want them to be consistent in XEmacs. * regex.c (print_partial_compiled_pattern): Print the flags for charset_mule; don't print non-ASCII as the character values in ranges, this breaks with locales. * regex.c (enum): Define various flags the charset_mule and charset_mule_not opcodes can now take. * regex.c (CHAR_CLASS_MAX_LENGTH): Update this. * regex.c (re_iswctype, re_wctype): New, from GNU. * regex.c (re_wctype_can_match_non_ascii): New; used when deciding on whether to use charset_mule or the ASCII-only regex character set opcode. * regex.c (regex_compile): Error correctly on long, non-existent character class names. Break out the handling of charsets that can match non-ASCII into a separate clause. Use compile_char_class when compiling character classes. * regex.c (compile_char_class): New. Used in regex_compile when compiling character sets that may match non-ASCII. * regex.c (re_compile_fastmap): If there are flags set for charset_mule or charset_mule_not, we can't use the fastmap (since we need to check syntax table values that aren't available there). * regex.c (re_match_2_internal): Check the new flags passed to the charset_mule{,_not} opcode, observe them if appropriate. * regex.h: * regex.h (enum): Expose re_wctype_t here, imported from GNU. tests/ChangeLog addition: 2012-04-21 Aidan Kehoe <kehoea@parhasard.net> * automated/regexp-tests.el: * automated/regexp-tests.el (Assert-char-class): Check that #'string-match errors correctly with an over-long character class name. Add tests for character class functionality that supports non-ASCII characters. These tests expose bugs in GNU Emacs 24.0.94.2, but pass under current XEmacs.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 21 Apr 2012 18:58:28 +0100
parents 1f0b15040456
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5494
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
1 /* Definitions file for GNU Emacs running on bsd 4.3
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
2 Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006,
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
3 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
4 Copyright (C) 2010 Ben Wing.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
613
023b83f4e54b [xemacs-hg @ 2001-06-10 10:42:16 by ben]
ben
parents: 0
diff changeset
6 This file is part of XEmacs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
5495
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
8 XEmacs is free software: you can redistribute it and/or modify it
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
9 under the terms of the GNU General Public License as published by the
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
10 Free Software Foundation, either version 3 of the License, or (at your
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
11 option) any later version.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
5495
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
16 for more details.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
5495
Aidan Kehoe <kehoea@parhasard.net>
parents: 5494
diff changeset
19 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
5494
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
21 /* Synced up with: FSF 23.1.92 */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
22 /* Synced by: Ben Wing, 2-17-10 */
4759
aa5ed11f473b Remove support for obsolete systems. See xemacs-patches message with ID
Jerry James <james@xemacs.org>
parents: 613
diff changeset
23
5494
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
24 /*
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
25 * Define symbols to identify the version of Unix this is.
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
26 * Define all the symbols that apply correctly.
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
27 */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 /* We give these symbols the numeric values found in <sys/param.h> to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 avoid warnings about redefined macros. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #ifndef BSD4_3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #define BSD4_3 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #endif /* BSD4_3 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
5494
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
35 #ifndef BSD_SYSTEM
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
36 #define BSD_SYSTEM 43
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
37 #endif /* BSD_SYSTEM */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
38
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
39 /* SYSTEM_TYPE should indicate the kind of system you are using.
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
40 * It sets the Lisp variable system-type. */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
41
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
42 #define SYSTEM_TYPE "berkeley-unix"
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
43
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
44 /* Deleted INTERRUPT_INPUT, FIRST_PTY_LETTER, HAVE_PTYS, HAVE_SOCKETS,
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
45 BSTRING -- unnecessary and/or autoconfigured on XEmacs */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
46
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 /* define MAIL_USE_FLOCK if the mailer uses flock
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 to interlock access to /usr/spool/mail/$USER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 The alternative is that a lock file named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 /usr/spool/mail/$USER.lock. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #define MAIL_USE_FLOCK
5494
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
53
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
54 /* Deleted CLASH_DETECTION, KERNEL_FILE, LDAV_SYMBOL, SIGNALS_VIA_CHARACTERS
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
55 -- unnecessary and/or autoconfigured on XEmacs */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
56
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
57 /* arch-tag: 0c367245-bde3-492e-9029-3ff6898beb95
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
58 (do not change this comment) */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
59
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
60 /* XEmacs addition: `ifdef BSD' used in many places */
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
61
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
62 #ifndef BSD
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
63 #define BSD 43
861f2601a38b Sync s/ files with GNU 23.1.92, delete obsolete stuff, simplify other stuff
Ben Wing <ben@xemacs.org>
parents: 4759
diff changeset
64 #endif /* BSD */