From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#396: marked as done (23.0.60; Quail (swedish postfix) broken in console) Date: Sat, 14 Jun 2008 21:55:05 -0700 Message-ID: References: <20080612125602.842C35C036@sol.lannerback.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1213505705-7217-0" X-Trace: ger.gmane.org 1213506450 16973 80.91.229.12 (15 Jun 2008 05:07:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Jun 2008 05:07:30 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 15 07:08:13 2008 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.50) id 1K7kTM-0005Dq-0X for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jun 2008 07:08:12 +0200 Original-Received: from localhost ([127.0.0.1]:48006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7kSX-0001c8-Nm for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jun 2008 01:07:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7kSQ-0001bz-OR for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2008 01:07:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7kSP-0001bf-8y for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2008 01:07:13 -0400 Original-Received: from [199.232.76.173] (port=41625 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7kSP-0001bc-0D for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2008 01:07:13 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45932) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K7kSO-0006Le-8o for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2008 01:07:12 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5F578Ac011439; Sat, 14 Jun 2008 22:07:08 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5F4t5XU007339; Sat, 14 Jun 2008 21:55:05 -0700 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 396 X-Emacs-PR-Package: emacs X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:18403 Archived-At: This is a multi-part message in MIME format... ------------=_1213505705-7217-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 15 Jun 2008 00:46:36 -0400 with message-id and subject line Re: bug#396: 23.0.60; Quail (swedish postfix) broken in co= nsole has caused the Emacs bug report #396, regarding 23.0.60; Quail (swedish postfix) broken in console to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact don@donarmstrong.com immediately.) --=20 396: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D396 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1213505705-7217-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 12 Jun 2008 12:56:15 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5CCuASg000583 for ; Thu, 12 Jun 2008 05:56:13 -0700 Received: from mx10.gnu.org ([199.232.76.166]:48289) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1K6mJa-00012K-O5 for emacs-pretest-bug@gnu.org; Thu, 12 Jun 2008 08:54:06 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1K6mLV-0001Xa-8g for emacs-pretest-bug@gnu.org; Thu, 12 Jun 2008 08:56:09 -0400 Received: from proxy3.bredband.net ([195.54.101.73]:36650) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6mLU-0001X8-TJ for emacs-pretest-bug@gnu.org; Thu, 12 Jun 2008 08:56:05 -0400 Received: from ironport.bredband.com (195.54.101.120) by proxy3.bredband.net (7.3.127) id 481183EA00E302AF for emacs-pretest-bug@gnu.org; Thu, 12 Jun 2008 14:56:02 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhM4ABW6UEhV4nOzPGdsb2JhbACBW5A3AQEBAS2bKw Received: from c-b373e255.07-158-73746f32.cust.bredbandsbolaget.se (HELO sol.lannerback.net) ([85.226.115.179]) by ironport1.bredband.com with ESMTP; 12 Jun 2008 14:56:02 +0200 Received: by sol.lannerback.net (Postfix, from userid 1000) id 842C35C036; Thu, 12 Jun 2008 14:56:02 +0200 (CEST) From: "E. Anders =?iso-8859-1?Q?Lannerb=E4ck?=" To: emacs-pretest-bug@gnu.org Subject: 23.0.60; Quail (swedish postfix) broken in console MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Message-Id: <20080612125602.842C35C036@sol.lannerback.net> Date: Thu, 12 Jun 2008 14:56:02 +0200 (CEST) Content-Transfer-Encoding: Quoted-Printable X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Since the merge of the unicode branch on Feb 1, the quail package swedish-postfix has been broken in console. When using X11 it works. Also, there is no problem to use the Swedish keyboard, so I believe that the problem is in quail. How to reproduce: emacs -q -nw C-x b f o o RET C-x RET C-\ s w e d i s h - p o s t f i x RET a a SPC SPC Instead of the string "=C3=A5 " I end up with =E5=A0=A0 (#x5820). =20 Regards /Anders L ------------=_1213505705-7217-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.5 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 396-close) by emacsbugs.donarmstrong.com; 15 Jun 2008 04:46:47 +0000 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5F4kgAY006001 for <396-close@emacsbugs.donarmstrong.com>; Sat, 14 Jun 2008 21:46:44 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEAPA6VEjO+KWv/2dsb2JhbACBW6pa X-IronPort-AV: E=Sophos;i="4.27,646,1204520400"; d="scan'208";a="22664455" Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 15 Jun 2008 00:46:37 -0400 Received: from pastel.home ([206.248.165.175]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id VKJ06237; Sun, 15 Jun 2008 00:46:37 -0400 Received: by pastel.home (Postfix, from userid 20848) id A19407FBD; Sun, 15 Jun 2008 00:46:36 -0400 (EDT) From: Stefan Monnier To: 396-close@emacsbugs.donarmstrong.com, Kenichi Handa Subject: Re: bug#396: 23.0.60; Quail (swedish postfix) broken in console Message-ID: References: <20080612125602.842C35C036@sol.lannerback.net> Date: Sun, 15 Jun 2008 00:46:36 -0400 In-Reply-To: <20080612125602.842C35C036@sol.lannerback.net> (E. Anders's message of "Thu, 12 Jun 2008 14:56:02 +0200 (CEST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Since the merge of the unicode branch on Feb 1, the quail package > swedish-postfix has been broken in console. When using X11 it works. > Also, there is no problem to use the Swedish keyboard, so I believe that > the problem is in quail. > C-x b f o o RET C-x RET C-\ s w e d i s h - p o s t > f i x RET a a SPC SPC > Instead of the string "=C3=A5 " I end up with =E5=A0=A0 (#x5820).=20=20 Yuck! Here's what seems to be happening: quail takes a sequence of bytes from your terminal, interprets them as ascii chars, and turns this sequence into another sequence, which is composed of latin-1 chars, but which encoded-kbd then takes for bytes coming straight from your terminal, so it decodes this sequence as a utf-8 encoded char: "a a" turns into #xe5 and somehow encoded-kbd confuses "#xe5 SPC SPC" for "#xE5 #xA0 #xA0". I've installed the patch below which should fix your problem most of the time. But to fix it right, I think we'd need to hook encoded-kbd earlier in the chain so it gets processed before input-methods are run. Stefan --- encoded-kb.el.~1.45.~ 2008-05-06 23:35:23.000000000 -0400 +++ encoded-kb.el 2008-06-15 00:39:58.000000000 -0400 @@ -219,8 +219,9 @@ =20 (defun encoded-kbd-self-insert-utf-8 (arg) (interactive "p") - (let ((char (encoded-kbd-last-key)) - len) + (let* ((lead (encoded-kbd-last-key)) + (char lead) + len event) (cond ((< char #xE0) (setq len 1 char (logand char #x1F))) ((< char #xF0) @@ -230,8 +231,22 @@ (t (setq len 4 char 0))) (while (> len 0) - (setq char (logior (lsh char 6) (logand (read-char-exclusive) #x3F)) - len (1- len))) + (setq event (read-char-exclusive)) + (if (and (>=3D event #x80) (< event #xc0)) + ;; Valid utf-8 sequence. + (setq char (logior (lsh char 6) (- event #x80)) + len (1- len)) + ;; Invalid utf-8 sequence. Might be because Quail got involved + ;; in-between and the bytes we thought we were reading were actual= ly + ;; latin-1 chars. Let's presume that `event' is the second "byte", + ;; i.e. there weren't any "apprently correct" between `lead' and + ;; `event': it's easy to recover in this case, and the more general + ;; case seems pretty unlikely. + ;; FIXME: We should really do encoded-kbd decoding before processi= ng + ;; input-methods. + (push event unread-command-events) + (setq char lead) + (setq len 0))) (vector char))) =20 (defun encoded-kbd-setup-keymap (keymap coding) ------------=_1213505705-7217-0--