From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Remove char-direction Date: Sat, 23 Apr 2011 20:43:40 +0300 Message-ID: <83hb9oc183.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1303580644 4489 80.91.229.12 (23 Apr 2011 17:44:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2011 17:44:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 23 19:43:58 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 1QDgs9-0002Rx-VZ for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2011 19:43:58 +0200 Original-Received: from localhost ([::1]:43152 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDgs9-000178-Gh for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2011 13:43:57 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDgs7-000173-9V for emacs-devel@gnu.org; Sat, 23 Apr 2011 13:43:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDgs6-0007OS-GV for emacs-devel@gnu.org; Sat, 23 Apr 2011 13:43:55 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:38321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDgs6-0007O4-A6 for emacs-devel@gnu.org; Sat, 23 Apr 2011 13:43:54 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LK40090092CJL00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 23 Apr 2011 20:43:40 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.55.52]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LK4007IB98QN6S0@a-mtaout20.012.net.il>; Sat, 23 Apr 2011 20:43:40 +0300 (IDT) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 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:138656 Archived-At: The function char-direction is obsolete, and is buggy. It is buggy, because the char-table on which it is based (char-direction-table, see character.c) is initialized to all ones, so char-direction thinks every character is right-to-left(!). It is obsolete because we have (get-char-code-property CH 'bidi-class) which consults the bidirectional properties of the character CH derived from the Unicode database. By contrast, char-direction assumes each character is either left-to-right or right-to-left, and doesn't know about weak characters and neutrals (which assume directionality of the surrounding text, and are therefore neither left-to-right nor right-to-left by themselves). Rather than fix this function, I suggest deleting it. It is not used anywhere in Emacs, AFAICS. It is also not advertised in the ELisp manual. Should it be needed in the future, it would be trivial to implement it in Lisp, using get-char-code-property. Comments?