bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#30458: 26.0; `ucs-names': No reverse lookup function now


From: Drew Adams
Subject: bug#30458: 26.0; `ucs-names': No reverse lookup function now
Date: Wed, 14 Feb 2018 13:09:41 -0800 (PST)

> > Before Emacs 26, `ucs-names' was an alist.  That meant that you could
> > not only look up a character, given its name or code, but you could
> > also easily look up a character name, given the character:
> >
> > (car (rassq CHARACTER (ucs-names)))
> >
> > How is this done now, with (ucs-names) returning a hash table?
> >
> > There is now a function `char-from-name', to replace the former forward
> > alist lookup (car (assoc CHAR-NAME (ucs-names))).  But there doesn't
> > seem to be any reverse lookup now for `ucs-names' (e.g. `char-name' or
> > `char-name-from-char').
> 
> Looking at the implementation of ucs-names, does get-char-code-property
> do what you want ?
> 
> (char-from-name "GREEK SMALL LETTER LAMBDA") => 955
> (char-from-name "GREEK SMALL LETTER LAMDA") => 955
> (get-char-code-property 955 'name) => "GREEK SMALL LETTER LAMDA"
> (get-char-code-property 955 'old-name) => "GREEK SMALL LETTER LAMBDA"

Yes, thanks.  I had forgotten about that function.

Still, I would ask to have general reverse-lookup functions
for a hash table, as well.  Would someone please retitle this
bug for that?





reply via email to

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