From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#30458: 26.0; `ucs-names': No reverse lookup function now Date: Wed, 14 Feb 2018 19:04:11 +0000 Message-ID: References: <35ab0734-9032-4331-90e8-825f58fba059@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1518635207 4530 195.159.176.226 (14 Feb 2018 19:06:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2018 19:06:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (windows-nt) To: 30458@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 14 20:06:42 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em2NW-00074f-HM for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Feb 2018 20:06:02 +0100 Original-Received: from localhost ([::1]:50581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2PY-000315-7j for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Feb 2018 14:08:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2Nb-0001cd-Pz for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:06:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em2NX-0003pP-Rc for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:06:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35259) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em2NX-0003pJ-Nj for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:06:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1em2NV-0004te-Nm for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:06:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <35ab0734-9032-4331-90e8-825f58fba059@default> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2018 19:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30458 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151863514618801 (code B ref -1); Wed, 14 Feb 2018 19:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2018 19:05:46 +0000 Original-Received: from localhost ([127.0.0.1]:43156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em2NG-0004tB-FF for submit@debbugs.gnu.org; Wed, 14 Feb 2018 14:05:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em2NF-0004sz-26 for submit@debbugs.gnu.org; Wed, 14 Feb 2018 14:05:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em2N9-0003bk-3v for submit@debbugs.gnu.org; Wed, 14 Feb 2018 14:05:39 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1em2N9-0003ba-0y for submit@debbugs.gnu.org; Wed, 14 Feb 2018 14:05:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2N7-0001Br-MP for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:05:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em2N3-0003We-PP for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:05:37 -0500 Original-Received: from [195.159.176.226] (port=37230 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em2N3-0003Un-Ir for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 14:05:33 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1em2KZ-0004Yt-4Y for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2018 20:02:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:T81gIntaxAtW++3WXYM975yxs20= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143284 Archived-At: On Wed 14 Feb 2018, Drew Adams wrote: > 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" HTH, AndyM