From: Drew Adams <drew.adams@oracle.com>
To: Andy Moreton <andrewjmoreton@gmail.com>, 30458@debbugs.gnu.org
Subject: bug#30458: 26.0; `ucs-names': No reverse lookup function now
Date: Wed, 14 Feb 2018 13:09:41 -0800 (PST) [thread overview]
Message-ID: <18b6852e-c4c7-4fa9-ab8f-916c10d001a8@default> (raw)
In-Reply-To: <vz1po57o0k4.fsf@gmail.com>
> > 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?
next prev parent reply other threads:[~2018-02-14 21:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 17:41 bug#30458: 26.0; `ucs-names': No reverse lookup function now Drew Adams
2018-02-14 19:04 ` Andy Moreton
2018-02-14 21:09 ` Drew Adams [this message]
2018-02-15 2:01 ` Noam Postavsky
2021-08-12 14:40 ` bug#30458: hash table reverse-lookup (get-keys VALUE TABLE) => KEYS Lars Ingebrigtsen
2021-08-12 15:08 ` bug#30458: [External] : " Drew Adams
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=18b6852e-c4c7-4fa9-ab8f-916c10d001a8@default \
--to=drew.adams@oracle.com \
--cc=30458@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
/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.