emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: describe-char should display the character's Unicode name


From: Kenichi Handa
Subject: Re: describe-char should display the character's Unicode name
Date: Sat, 19 Jul 2008 10:11:31 +0900
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)

In article <address@hidden>, Juri Linkov <address@hidden> 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
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]