case charset_not:
- /* Chars beyond end of map must be allowed. End of map is
- `127' if bufp->multibyte is nonzero. */
- simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH);
+ /* Chars beyond end of bitmap are possible matches.
+ All the single-byte codes can occur in multibyte buffers.
+ So any that are not listed in the charset
+ are possible matches, even in multibyte buffers. */
+ simple_char_max = (1 << BYTEWIDTH);
for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH;
j < simple_char_max; j++)
fastmap[j] = 1;
case wordchar:
- simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH);
+ /* All the single-byte codes can occur in multibyte buffers,
+ and they may have word syntax. So do consider them. */
+ simple_char_max = (1 << BYTEWIDTH);
for (j = 0; j < simple_char_max; j++)
if (SYNTAX (j) == Sword)
fastmap[j] = 1;
case notwordchar:
- simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH);
+ /* All the single-byte codes can occur in multibyte buffers,
+ and they may not have word syntax. So do consider them. */
+ simple_char_max = (1 << BYTEWIDTH);
for (j = 0; j < simple_char_max; j++)
if (SYNTAX (j) != Sword)
fastmap[j] = 1;
{
int fastmap_newline = fastmap['\n'];
- /* `.' matches anything (but if bufp->multibyte is
- nonzero, matches `\000' .. `\127' and possible multibyte
- character) ... */
+ /* `.' matches anything, except perhaps newline.
+ Even in a multibyte buffer, it should match any
+ conceivable byte value for the fastmap. */
if (bufp->multibyte)
- {
- simple_char_max = 0x80;
-
- for (j = 0x80; j < 0xA0; j++)
- if (BASE_LEADING_CODE_P (j))
- fastmap[j] = 1;
- match_any_multibyte_characters = true;
- }
- else
- simple_char_max = (1 << BYTEWIDTH);
+ match_any_multibyte_characters = true;
+ simple_char_max = (1 << BYTEWIDTH);
for (j = 0; j < simple_char_max; j++)
fastmap[j] = 1;
case categoryspec:
k = *p++;
- simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH);
+ simple_char_max = (1 << BYTEWIDTH);
for (j = 0; j < simple_char_max; j++)
if (CHAR_HAS_CATEGORY (j, k))
fastmap[j] = 1;
case notcategoryspec:
k = *p++;
- simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH);
+ simple_char_max = (1 << BYTEWIDTH);
for (j = 0; j < simple_char_max; j++)
if (!CHAR_HAS_CATEGORY (j, k))
fastmap[j] = 1;