GNU bug report logs -
#6080
Behaviour of `char-syntax' changes when byte-compiled
Previous Next
Full log
View this message in rfc822 format
On Mon, May 03, 2010 at 01:05:40PM -0400, Stefan Monnier wrote:
> > (defun test ()
> > (let ((char 33554464))
> > (message "char: %s" char)
> > (message "syntax: %s" (char-syntax char)))
> > nil)
>
> > (Note that 33554464 is the value of `last-input-event' when a command is
> > invoked by the key sequence "S-<SPC>".)
>
> > When the test function is evalled and then run with "M-: (test)", it
> > outputs the following in the *Messages* buffer:
>
> > char: 33554464
> > syntax: 32
> > nil
>
> That's an error: S-SPC is not a char, so the function should signal
> an error.
Good to know which is considered the correct behaviour.
> > When the test function is byte-compiled, loaded, and run as before with
> > "M-: (test)", it throws an error and produces the following backtrace:
>
> Yes, oddly enough (it probably made sense at some point, of course, but
> that point was passed a very long time ago), char-syntax has its own
> byte code, so what happens above is that the byte-code version of
> char-syntax is not implemented in the exact same way as
> char-syntax function.
Interesting! So the byte-compiler replaces a char-syntax call with
hand-crafted byte-code, and bypasses the version in syntax.c entirely?
Will you fix the char-syntax function so that it signals an error in this
case? If so, then I won't bother working around this Emacs bug, as it was
a minor issue and I can just tell people to byte-compile to fix it.
Toby
--
Dr T. S. Cubitt
Quantum Information Theory group
Department of Mathematics
University of Bristol
United Kingdom
email: tsc25 <at> cantab.net
web: www.dr-qubit.org
This bug report was last modified 15 years and 14 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.