From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: reverting CJK input methods Date: Fri, 30 Apr 2004 14:06:13 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200404300506.OAA01563@etlken.m17n.org> References: <20040429.150303.42778779.wl@gnu.org> <200404300142.KAA01027@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1083301889 6911 80.91.224.253 (30 Apr 2004 05:11:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Apr 2004 05:11:29 +0000 (UTC) Cc: wl@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 30 07:11:19 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJQIx-000535-00 for ; Fri, 30 Apr 2004 07:11:19 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJQIx-0004Cc-00 for ; Fri, 30 Apr 2004 07:11:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BJQHh-0004e5-Go for emacs-devel@quimby.gnus.org; Fri, 30 Apr 2004 01:10:01 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BJQHD-0004d6-EJ for emacs-devel@gnu.org; Fri, 30 Apr 2004 01:09:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BJQGf-0004Qi-MD for emacs-devel@gnu.org; Fri, 30 Apr 2004 01:09:29 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BJQG1-00046G-M5; Fri, 30 Apr 2004 01:08:17 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by mx20.gnu.org with esmtp (Exim 4.30) id 1BJQEC-0002SL-7Q; Fri, 30 Apr 2004 01:06:24 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.11.6p2/8.11.6) with ESMTP id i3U56E806547; Fri, 30 Apr 2004 14:06:14 +0900 (JST) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.6p2/8.11.6) with ESMTP id i3U56D913140; Fri, 30 Apr 2004 14:06:13 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id OAA01563; Fri, 30 Apr 2004 14:06:13 +0900 (JST) Original-To: miles@gnu.org In-reply-to: (message from Miles Bader on 30 Apr 2004 11:03:09 +0900) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22409 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22409 In article , Miles Bader writes: > Kenichi Handa writes: >> Please evaluate the attached code, activate some input method, input >> some character, go to that character, and do M-x quail-find-key RET. > let: Wrong type argument: listp, quail-japanese-switch-package Oops, please try the attached new one. But, for the input method "Japanese", we can't show key for Kanji characters because the Kanji characters are generated from the input hiragana sequence by the different program than quail. > Oh, but it seemed to work well with some other input method, like > `german'. > I think this would be nice to add to the output for `C-u C-x =3D'. > E.g.,=20 > character: =F6 (04366, 2294, 0x8f6, U+00F6) > charset: latin-iso8859-1 > (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.) > ... > keystroke: =F6 can be input by typing ";" > (using the `german' input method) > ... Ah, yes, this is also a good idea. --- Ken'ichi HANDA handa@m17n.org (defun quail-find-key (char map key) (when (and (consp map) (listp (cdr map))) (let ((translation (car map))) (cond ((integerp translation) (if (=3D translation char) (throw 'tag key))) ((stringp translation) (if (string-match (string char) translation) (throw 'tag key))) ((vectorp translation) (dotimes (i (length translation)) (let ((target (aref translation i))) (if (integerp target) (if (=3D target char) (throw 'tag key)) (if (and (=3D (length target) 1) (=3D (aref target 0) char)) (throw 'tag key)))))) ((consp translation) (setq translation (cdr translation)) (dotimes (i (length translation)) (let ((target (aref translation i))) (if (integerp target) (if (=3D target char) (throw 'tag key)) (if (and (=3D (length target) 1) (=3D (aref target 0) char)) (throw 'tag key)))))))) (dolist (elt (cdr map)) (quail-find-key char (cdr elt) (cons (car elt) key))))) (defun quail-show-key () (interactive) (let* ((char (following-char)) (key (catch 'tag (quail-find-key char (quail-map) nil)))) (if key (message "%c can be input by typing \"%s\"" char (apply 'string (nreverse key))) (message "%c can't be input by the current input method" char))))