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: describe-char should display the character's Unicode name Date: Sat, 19 Jul 2008 10:11:31 +0900 Message-ID: References: <868ww3vydn.fsf@lifelogs.com> <87myki6fqp.fsf@jurta.org> <87mykhz6tf.fsf@jurta.org> <87tzeokrku.fsf@jurta.org> <87od4wgg8p.fsf@catnip.gol.com> <86od4vmi5i.fsf@lifelogs.com> <873am6n21q.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1216429925 24202 80.91.229.12 (19 Jul 2008 01:12:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jul 2008 01:12:05 +0000 (UTC) Cc: tzz@lifelogs.com, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 19 03:12:54 2008 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 1KK10E-0003t1-6y for ged-emacs-devel@m.gmane.org; Sat, 19 Jul 2008 03:12:50 +0200 Original-Received: from localhost ([127.0.0.1]:53088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK0zL-0006s6-8I for ged-emacs-devel@m.gmane.org; Fri, 18 Jul 2008 21:11:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KK0z1-0006df-RS for emacs-devel@gnu.org; Fri, 18 Jul 2008 21:11:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KK0z1-0006dK-9G for emacs-devel@gnu.org; Fri, 18 Jul 2008 21:11:35 -0400 Original-Received: from [199.232.76.173] (port=36289 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK0z1-0006dF-5O for emacs-devel@gnu.org; Fri, 18 Jul 2008 21:11:35 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:44916) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KK0z0-0001xQ-Ft for emacs-devel@gnu.org; Fri, 18 Jul 2008 21:11:35 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m6J1BWxx008312; Sat, 19 Jul 2008 10:11:32 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m6J1BVcl029855; Sat, 19 Jul 2008 10:11:31 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id m6J1BVoY029445; Sat, 19 Jul 2008 10:11:31 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1KK0yx-0006kT-Kg; Sat, 19 Jul 2008 10:11:31 +0900 In-reply-to: <873am6n21q.fsf@jurta.org> (message from Juri Linkov on Sat, 19 Jul 2008 03:35:45 +0300) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: 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:100969 Archived-At: In article <873am6n21q.fsf@jurta.org>, Juri Linkov writes: > There is no problem with completion in a new function below created > to read a character by its Unicode name or hex number string. There > is only a small delay when it creates the completion list, and a > longer delay when it displays the *Completions* buffer with all > Unicode names: > Index: lisp/international/mule-cmds.el [...] > + (defun read-char-by-name (prompt) > + "Read a character by its Unicode name or hex number string. > + Display PROMPT and read a string that represent a character > + by its Unicode property `name' or `old-name'. It also accepts > + a hexadecimal number of Unicode code point. Returns a character > + as a number." > + (let (name names) > + (dotimes (c #x10FFFF) > + (if (setq name (get-char-code-property c 'name)) > + (setq names (cons (cons name c) names))) > + (if (setq name (get-char-code-property c 'old-name)) > + (setq names (cons (cons name c) names)))) > + (or (cdr (assoc (setq name (completing-read prompt names)) names)) > + (string-to-number name 16)))) > + I think it is better to skip these ranges: #x3400..#x4dbf -- CJK Ideograph Extension A #x4e00..#x9fff -- CJK Ideograph #xd800..#xfaFF -- surroage-pair, private use, CJK COMPATIBILITY IDEOGRAPH #x20000..#x2ffff -- CJK Ideograph Extension B and end the loop at #xeffff (#xf0000.. are for private use) --- Kenichi Handa handa@ni.aist.go.jp