From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: assertion failed: c == event->code Date: Thu, 13 Dec 2007 14:16:35 +0000 Message-ID: <47613EC3.7020004@gnu.org> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1197555422 9007 80.91.229.10 (13 Dec 2007 14:17:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2007 14:17:02 +0000 (UTC) Cc: Stefan Monnier , Emacs-Devel To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 13 15:24:06 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1J2oys-0002yD-0D for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2007 15:24:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2ors-0005Is-W6 for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2007 09:16:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2orn-0005I1-B4 for emacs-devel@gnu.org; Thu, 13 Dec 2007 09:16:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2ork-0005FC-Kx for emacs-devel@gnu.org; Thu, 13 Dec 2007 09:16:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2ork-0005Es-93 for emacs-devel@gnu.org; Thu, 13 Dec 2007 09:16:44 -0500 Original-Received: from mk-outboundfilter-3-a-1.mail.uk.tiscali.com ([212.74.114.7]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2ork-000545-9K for emacs-devel@gnu.org; Thu, 13 Dec 2007 09:16:44 -0500 Original-X-Trace: 707946/mk-outboundfilter-1.mail.uk.tiscali.com/F2S/$INTERNET-ACCEPTED/None/81.149.25.51 X-SBRS: None X-RemoteIP: 81.149.25.51 X-IP-MAIL-FROM: jasonr@gnu.org X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACLOYEdRlRkz/2dsb2JhbAAIqkg Original-Received: from host81-149-25-51.in-addr.btopenworld.com (HELO [192.168.1.69]) ([81.149.25.51]) by smtp.f2s.tiscali.co.uk with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2007 14:16:41 +0000 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85125 Archived-At: Juanma Barranquero wrote: > On Dec 12, 2007 6:30 PM, Stefan Monnier wrote: > > >> Hmm.. if you just remove this eassert, you should get back the previous >> behavior. But then I wonder: is this previous behavior correct, and if >> so, why? >> > > No idea. > > >> Basically, the issue is that when a key is pressed, the W32 code inserts >> a "ASCII_KEYSTROKE_EVENT" in the queue, even for non-ASCII chars, and >> then keyboard.c applies a "& 0377" to it, so there's a risk of losing >> some bits and turning a non-ASCII keypress into some ASCII char. >> > > Without the eassert, C-ñ returns ' (U+2018, translated from \221), C-ç > returns ‡ (U+2021, translated from \207). Not sure whether that is > intended or not. > What is your locale set to, and keyboard-coding-system? Also, does this happen with emacs -Q? Since Windows effectively blocks Cntl and AltGr being used together, the only sequences I can type are C-£ and C-¬, both of which work correctly with a UK English Windows locale, and keyboard-coding-system set to cp1252. Looking at the actual code for ASCII_KEYSTROKE_EVENT, it really means UNIBYTE_CHAR_KEYSTROKE_EVENT, as the mask is against \0377 (0xff), and a test in xterm.c tests for SINGLE_BYTE_CHAR_P. Other naming in that enum is not clear, as NONASCII_KEYSTROKE_EVENT actually means FUNCTION_KEYSTROKE_EVENT, or NON_CHAR_KEYSTROKE_EVENT. MULTIBYTE_CHAR_KEYSTROKE_EVENT seems clearer, but it is not clear from the comments, nor the code in xterm.c, whether it should be an emacs-mule encoded character, or a double byte character in the keyboard coding system, as the code in xterm.c seems to generate both.