From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: bug#5380: Problem with command sgml-name-8bit-mode in GNU emacs 23.1 Date: Thu, 21 Jan 2010 11:47:46 +0900 Message-ID: References: <4B4F97A9.1080506@freenet.de> <87tyugfcfs.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=euc-jp Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1264042095 32083 80.91.229.12 (21 Jan 2010 02:48:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2010 02:48:15 +0000 (UTC) Cc: 5380@debbugs.gnu.org, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 21 03:48:07 2010 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 1NXn5b-00059T-Es for ged-emacs-devel@m.gmane.org; Thu, 21 Jan 2010 03:48:07 +0100 Original-Received: from localhost ([127.0.0.1]:56706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXn5c-0001di-3V for ged-emacs-devel@m.gmane.org; Wed, 20 Jan 2010 21:48:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXn5Y-0001d7-Ah for emacs-devel@gnu.org; Wed, 20 Jan 2010 21:48:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXn5T-0001Wf-HL for emacs-devel@gnu.org; Wed, 20 Jan 2010 21:48:03 -0500 Original-Received: from [199.232.76.173] (port=41627 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXn5T-0001WU-Dx for emacs-devel@gnu.org; Wed, 20 Jan 2010 21:47:59 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:65094) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXn5S-0004gG-Nw for emacs-devel@gnu.org; Wed, 20 Jan 2010 21:47:59 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o0L2lkPr006936; Thu, 21 Jan 2010 11:47:46 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o0L2lksq001565; Thu, 21 Jan 2010 11:47:46 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id o0L2lkuP008162; Thu, 21 Jan 2010 11:47:46 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1NXn5G-0007Nl-7o; Thu, 21 Jan 2010 11:47:46 +0900 In-Reply-To: <87tyugfcfs.fsf@stupidchicken.com> (message from Chong Yidong on Wed, 20 Jan 2010 20:56:23 -0500) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:120268 Archived-At: In article <87tyugfcfs.fsf@stupidchicken.com>, Chong Yidong writes: > Could someone with a non-English keyboard please try to debug Bug#5380? > > I encountered a problem with the function ``sgml-name-8bit-mode'', > > (menu option (SGML/Toggle 8 bit insertion)... After switching on the > > ``sgml name entity mode'' typing an umlaut character like =8F=AB=A3 (a = umlaut) > > now no more (as in previous emacs versions and as expected) produces > > ``ä'' but ``\344''. > In sgml-mode-map, we do the following: > (let ((c 127) > (map (nth 1 map))) > (while (< (setq c (1+ c)) 256) > (aset map c 'sgml-maybe-name-self))) > where > (defun sgml-maybe-name-self () > "Insert a symbolic character name according to `sgml-char-names'." > (interactive "*") > (if sgml-name-8bit-mode > (let ((mc last-command-event)) > (if (< mc 256) > (setq mc (unibyte-char-to-multibyte mc))) > (or mc (setq mc last-command-event)) > (sgml-name-char mc)) > (self-insert-command 1))) > This must have broken with the switch to unicode,=20 As Emacs receives already decoded character event now, defining sgml-maybe-name-self simply as below will work. (defun sgml-maybe-name-self () "Insert a symbolic character name according to `sgml-char-names'." (interactive "*") (if sgml-name-8bit-mode (sgml-name-char last-command-event) (self-insert-command 1))) > but it's inconvenient for me to debug without a keyboard > that can produce these characters. You can test it as below: (let ((sgml-name-8bit-mode t) (last-command-event #xC0)) (call-interactively 'sgml-maybe-name-self)) --- Kenichi Handa handa@m17n.org