[Top][All Lists]

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

Remove char-direction

From: Eli Zaretskii
Subject: Remove char-direction
Date: Sat, 23 Apr 2011 20:43:40 +0300

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.


reply via email to

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