From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.bugs Subject: bug#6080: Behaviour of `char-syntax' changes when byte-compiled Date: Mon, 3 May 2010 20:26:14 +0100 Message-ID: <20100503192614.GA22641@c3po> References: <20100502111517.GA29594@c3po> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272934004 6797 80.91.229.12 (4 May 2010 00:46:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 00:46:44 +0000 (UTC) Cc: 6080@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 04 02:46:43 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O96HU-0007EF-RT for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 May 2010 02:46:39 +0200 Original-Received: from localhost ([127.0.0.1]:41332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O96HP-0004By-PO for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 May 2010 20:46:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O91kJ-0004eZ-RR for bug-gnu-emacs@gnu.org; Mon, 03 May 2010 15:56:03 -0400 Original-Received: from [140.186.70.92] (port=36621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O91kI-0004dd-Av for bug-gnu-emacs@gnu.org; Mon, 03 May 2010 15:56:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O91kF-0002hT-W3 for bug-gnu-emacs@gnu.org; Mon, 03 May 2010 15:56:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50605) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O91kF-0002hI-N2 for bug-gnu-emacs@gnu.org; Mon, 03 May 2010 15:55:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O91M5-0005SX-NV; Mon, 03 May 2010 15:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Toby Cubitt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 May 2010 19:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6080 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6080-submit@debbugs.gnu.org id=B6080.127291503920979 (code B ref 6080); Mon, 03 May 2010 19:31:01 +0000 Original-Received: (at 6080) by debbugs.gnu.org; 3 May 2010 19:30:39 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O91Li-0005SK-Cx for submit@debbugs.gnu.org; Mon, 03 May 2010 15:30:38 -0400 Original-Received: from mail.geekisp.com ([216.168.135.169] helo=starfish.geekisp.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O91Ch-0005Nk-OV for 6080@debbugs.gnu.org; Mon, 03 May 2010 15:21:20 -0400 Original-Received: (qmail 28001 invoked by uid 1003); 3 May 2010 19:21:14 -0000 Original-Received: from c3po (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Mon, 03 May 2010 15:21:07 -0400 Content-Disposition: inline In-Reply-To: Fcc: ~/.offlineimap/GeekISP/INBOX/Sent/ User-Agent: Mutt/1.5.20 (2009-06-14) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org X-Mailman-Approved-At: Mon, 03 May 2010 15:30:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 03 May 2010 15:31:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Mon, 03 May 2010 20:46:26 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36674 Archived-At: 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-".) > > > 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