From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: assertion failed: c == event->code Date: Wed, 12 Dec 2007 15:05:16 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1197489996 16382 80.91.229.12 (12 Dec 2007 20:06:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2007 20:06:36 +0000 (UTC) Cc: Emacs-Devel To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 12 21:06:46 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2Xqn-0003em-0N for ged-emacs-devel@m.gmane.org; Wed, 12 Dec 2007 21:06:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2XqV-0002tn-1l for ged-emacs-devel@m.gmane.org; Wed, 12 Dec 2007 15:06:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2Xpb-0001oX-PL for emacs-devel@gnu.org; Wed, 12 Dec 2007 15:05:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2Xpa-0001ni-R2 for emacs-devel@gnu.org; Wed, 12 Dec 2007 15:05:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2Xpa-0001nR-J6 for emacs-devel@gnu.org; Wed, 12 Dec 2007 15:05:22 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2Xpa-0003Sl-3w for emacs-devel@gnu.org; Wed, 12 Dec 2007 15:05:22 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E0B522CF6FB; Wed, 12 Dec 2007 15:05:21 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 8699D3FE0; Wed, 12 Dec 2007 15:05:16 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 768D96CAB2; Wed, 12 Dec 2007 15:05:16 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Wed, 12 Dec 2007 19:00:05 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:85109 Archived-At: >> 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-=C3=B1 returns ' (U+2018, translated from \221), C= -=C3=A7 > returns =E2=80=A1 (U+2021, translated from \207). Not sure whether that is > intended or not. Well, what does it look like to you? To me it looks like a plain bug. Can you try the patch below? Stefan --- w32term.c.~1.276.~ 2007-11-09 10:15:55.000000000 -0500 +++ w32term.c 2007-12-12 14:43:54.000000000 -0500 @@ -4329,7 +4329,9 @@ if (temp_index =3D=3D sizeof temp_buffer / sizeof (short)) temp_index =3D 0; temp_buffer[temp_index++] =3D msg.msg.wParam; - inev.kind =3D ASCII_KEYSTROKE_EVENT; + inev.kind =3D (msg.msg.wParam < 0xff + ? ASCII_KEYSTROKE_EVENT + : MULTIBYTE_CHAR_KEYSTROKE_EVENT); inev.code =3D msg.msg.wParam; inev.modifiers =3D msg.dwModifiers; XSETFRAME (inev.frame_or_window, f);