all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: faster unicode character name completion
Date: Mon, 07 Dec 2009 11:00:41 +0900	[thread overview]
Message-ID: <tl7ocmbbl12.fsf@m17n.org> (raw)
In-Reply-To: <jwvy6lisryp.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Fri, 04 Dec 2009 10:07:57 -0500)

In article <jwvy6lisryp.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> 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




  parent reply	other threads:[~2009-12-07  2:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 19:55 Emacs 23.2 pretest freeze? Karl Fogel
2009-11-30 22:48 ` Chong Yidong
2009-11-30 23:05   ` Karl Fogel
2009-12-02 13:34   ` Alan Mackenzie
2009-12-03 21:35 ` Emacs 23.2 Pretest next week Chong Yidong
2009-12-04 11:23   ` faster unicode character name completion Kenichi Handa
2009-12-04 12:08     ` Deniz Dogan
2009-12-04 13:04     ` Juanma Barranquero
2009-12-04 13:26     ` Florian Beck
2009-12-04 15:07     ` Stefan Monnier
2009-12-04 22:38       ` Miles Bader
2009-12-07  2:00       ` Kenichi Handa [this message]
2009-12-07  8:13         ` Kenichi Handa
2009-12-07 14:57         ` Stefan Monnier
2009-12-07 20:28           ` Juri Linkov
2009-12-07 21:42             ` Stefan Monnier
2009-12-08  1:59               ` Miles Bader
2009-12-08  1:45           ` Kenichi Handa
2009-12-08  2:29             ` Stefan Monnier
2009-12-09  0:12             ` Chong Yidong
2009-12-09  0:57               ` Kenichi Handa
2009-12-09  9:02                 ` Deniz Dogan
2009-12-04 19:04   ` Emacs 23.2 Pretest next week Dan Nicolaescu
2009-12-04 21:15     ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tl7ocmbbl12.fsf@m17n.org \
    --to=handa@m17n.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.