From: Toby Cubitt <toby-dated-1274124074.5dc0e6@dr-qubit.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 6080@debbugs.gnu.org
Subject: bug#6080: Behaviour of `char-syntax' changes when byte-compiled
Date: Mon, 3 May 2010 20:26:14 +0100 [thread overview]
Message-ID: <20100503192614.GA22641@c3po> (raw)
In-Reply-To: <jwvsk692b2g.fsf-monnier+emacs@gnu.org>
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@cantab.net
web: www.dr-qubit.org
next prev parent reply other threads:[~2010-05-03 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 11:15 bug#6080: Behaviour of `char-syntax' changes when byte-compiled Toby Cubitt
2010-05-03 17:05 ` Stefan Monnier
2010-05-03 19:26 ` Toby Cubitt [this message]
2010-05-05 17:54 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100503192614.GA22641@c3po \
--to=toby-dated-1274124074.5dc0e6@dr-qubit.org \
--cc=6080@debbugs.gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).