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: faster unicode character name completion Date: Mon, 07 Dec 2009 11:00:41 +0900 Message-ID: References: <87einfbxdw.fsf@red-bean.com> <87fx7r68s4.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260151264 19166 80.91.229.12 (7 Dec 2009 02:01:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 02:01:04 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 07 03:00:56 2009 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 1NHSuE-0000pe-Ok for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2009 03:00:55 +0100 Original-Received: from localhost ([127.0.0.1]:43684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHSuE-0004DH-GP for ged-emacs-devel@m.gmane.org; Sun, 06 Dec 2009 21:00:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHSu9-0004Cy-Jo for emacs-devel@gnu.org; Sun, 06 Dec 2009 21:00:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHSu5-0004BG-PT for emacs-devel@gnu.org; Sun, 06 Dec 2009 21:00:49 -0500 Original-Received: from [199.232.76.173] (port=42793 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHSu5-0004BD-Ma for emacs-devel@gnu.org; Sun, 06 Dec 2009 21:00:45 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:64737) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHSu4-0007pg-Qb for emacs-devel@gnu.org; Sun, 06 Dec 2009 21:00:45 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id nB720g2i008605; Mon, 7 Dec 2009 11:00:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id nB720gUf027092; Mon, 7 Dec 2009 11:00:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id nB720f18021592; Mon, 7 Dec 2009 11:00:41 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1NHSu1-000054-GM; Mon, 07 Dec 2009 11:00:41 +0900 In-Reply-To: (message from Stefan Monnier on Fri, 04 Dec 2009 10:07:57 -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:118355 Archived-At: In article , Stefan Monnier writes: > > The drawback of the new code is that one can see only the > > list of the first words of character names in the completion > > buffer at once by C-x 8 RET TAB, instead of all of the > > unicode character names. > That's a pretty serious drawback as it prevents uses such as > C-x 8 RET *arro TAB. It may be possible to automatically fallback to the current way of building a full list in such a case. > Maybe another way to speed things up is to precompute the > ucs-completions lazy completion table at compilation time and store it > in a .elc file, so it can be "computed" by reading that file. > This can be done simply by having an autoloaded `ucs-completions' > function in a file where the ucs-completions variable is defined with an > eval-when-compile expression. Yes, that's one solution. > > (defun ucs-name-filter (str names) > > (let (l) > > (dolist (elt names) > > (if (eq (string-match str (car elt)) 0) > > (push elt l))) > > l)) > > (defun ucs-name-completion (str) > > (when (string-match "^[A-Za-z]*" str) > > (let ((head (match-string 0 str)) > > slot names) > > (if (and (= (length head) (length str)) > > (not (assoc-string str ucs-name-head-table))) > > (ucs-name-filter str ucs-name-head-table) > > (ucs-name-filter str (ucs-name-expand-table head)))))) > I don't understand what ucs-name-filter is trying to do. ?? It simply filters out elements that doesn't match with STR from NAMES (alist). --- Kenichi Handa handa@m17n.org