From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: handa Newsgroups: gmane.emacs.devel Subject: Re: idn.el and confusables.txt Date: Wed, 18 May 2011 14:23:26 +0900 Message-ID: References: <83wrhreukg.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1305696228 30578 80.91.229.12 (18 May 2011 05:23:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 May 2011 05:23:48 +0000 (UTC) Cc: tzz@lifelogs.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 18 07:23:44 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QMZEV-0008OU-25 for ged-emacs-devel@m.gmane.org; Wed, 18 May 2011 07:23:43 +0200 Original-Received: from localhost ([::1]:45055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMZEU-0003Pd-BM for ged-emacs-devel@m.gmane.org; Wed, 18 May 2011 01:23:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMZER-0003PY-9V for emacs-devel@gnu.org; Wed, 18 May 2011 01:23:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMZEQ-0000o4-4F for emacs-devel@gnu.org; Wed, 18 May 2011 01:23:39 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:38868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMZEN-0000nV-Qe; Wed, 18 May 2011 01:23:36 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id p4I5NSrL021503; Wed, 18 May 2011 14:23:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id p4I5NSLN010816; Wed, 18 May 2011 14:23:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id p4I5NRs1003263; Wed, 18 May 2011 14:23:27 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1QMZEF-0000lQ-8d; Wed, 18 May 2011 14:23:27 +0900 In-Reply-To: <83wrhreukg.fsf@gnu.org> (message from Eli Zaretskii on Sun, 15 May 2011 20:34:55 +0300) X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-Received-From: 150.29.246.133 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139478 Archived-At: In article <83wrhreukg.fsf@gnu.org>, Eli Zaretskii writes: > Are functions defined by ucs-normalize.el used anywhere? What do you mean by "anywhere". That file provides a coding system utf-8-hfs that uses functions in that file. And I don't know whether a specific coding system is used or not except for what I use. In addition, I have a plan of using the facility of normalization to display, for instance, the sequence 'A' '=CC=81' by '=C3=81' when a font doesn't support OTF GPOS features. > > Why did you have to create another table? Was it because > > get-char-code-property is defiend by Lisp and not efficient > > to call from C? > Yes, calling a Lisp function (one that calls `load' at that!) in the > lowest level of display engine was out of the question. Why? If that loading is just once, what's the problem? For automatic composition, we are already doing that. > But there were several other reasons as well: > . get-char-code-property returns a property list in which bidi types > are recorded as symbols, while I needed them as small numeric > values of a C enumerated type (see bidi_type_t), to fit in a small > number of bits in `struct glyph'. > . The data structures manipulated by get-char-code-property include > complications (e.g., a function in the extra slot) for which I > could find no documentation, so I couldn't figure out whether it > would be possible to replace get-char-code-property by a simple > call to CHAR_TABLE_REF. > . Even if I could use CHAR_TABLE_REF, the additional call to > plist-get means more overhead. bidi_get_type, the function which > needs to look up the bidirectional type of an arbitrary character, > runs in the innermost loop of the display engine, and is called at > least once (sometimes more) for every character in the displayed > portion of the buffer, so it must be very efficient. > . For bidi-mirrored property, the data in the `mirrored' property > recorded by uni-mirrored.el is simply inadequate: the value is a > boolean (albeit in a form of symbols `Y' and `N'). What I needed > was for each character its mirrored character, if there is one; > this data was simply not available in uni-mirrored.el. The > corresponding function bidi_mirror_char is also called for a large > percentage of displayed characters, and must be efficient. > It was extremely frustrating to have all that data at my fingertips > and not be able to use it for the purposes of bidi.c, which at first > seems like a first-class client of Unicode DB. What I wanted was > something similar to C ctype macros in simplicity and efficiency, but > nothing quite like that was available. A char-table comes close, but > it must be a simple table with numerical values -- and that is what > bidi.c currently uses, leaving uni-bidi.el unused. I understand your situation, and it's unfortunate that you didn't consult me to improve the situation. I think it's not difficult to write a C code that makes uni-* char-tables more easily be accessed from C without running Lisp. As for the value type of symbol vs integer in uni-bidi.el, it's possible to write a code to expose integer value to C, and the corresponding symbol to Lisp. As for the uni-mirrored.el, I think it's ok to change the value type to what you want (character or nil). --- Kenichi Handa handa@m17n.org