GNU bug report logs -
#53260
char-syntax differs in interpreter and bytecode
Previous Next
Full log
Message #14 received at 53260 <at> debbugs.gnu.org (full text, mbox):
15 jan. 2022 kl. 15.46 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:
> If you’re trying to determine the syntax of characters in the buffer,
> this is probably the wrong function to use, because it can’t take
> ‘syntax-table’ text properties into account. Consider using
> ‘syntax-after’ instead.
>
> The "can't" is because `char-syntax` doesn't know where the char comes from.
This is true and it leaves a narrower use for `char-syntax` in mode-specific code -- ie, when syntax-table text properties do not need to be taken into account.
I propose we do the following:
1. Remove SETUP_BUFFER_SYNTAX_TABLE() from Fchar_syntax because as far as I can tell it has no effect at all.
2. Remove make_char_multibyte(c) from Bchar_syntax because it seems to be the wrong thing to do: in a unibyte buffer, wouldn't the syntax table be indexed by byte value (so that char 255 in the buffer corresponds to entry 255 in the syntax table rather than entry 0x3fffff)?
3. Now both implementations are identical. Replace the one in the byte-code interpreter with a call to Fchar_syntax.
> I think he meant "rare" w.r.t dynamic count rather than static count.
Yes, that's right.
This bug report was last modified 3 years and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.