unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Remove char-direction
@ 2011-04-23 17:43 Eli Zaretskii
  2011-04-23 18:07 ` Drew Adams
  2011-04-24  5:02 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2011-04-23 17:43 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

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?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Remove char-direction
  2011-04-23 17:43 Remove char-direction Eli Zaretskii
@ 2011-04-23 18:07 ` Drew Adams
  2011-04-24  5:02 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2011-04-23 18:07 UTC (permalink / raw)
  To: 'Eli Zaretskii', 'Kenichi Handa'; +Cc: emacs-devel

> I suggest deleting it.

OK by me, FWIW.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remove char-direction
  2011-04-23 17:43 Remove char-direction Eli Zaretskii
  2011-04-23 18:07 ` Drew Adams
@ 2011-04-24  5:02 ` Stefan Monnier
  2011-04-24  7:16   ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2011-04-24  5:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, Kenichi Handa

> Rather than fix this function, I suggest deleting it.  It is not used

Off with their heads!


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remove char-direction
  2011-04-24  5:02 ` Stefan Monnier
@ 2011-04-24  7:16   ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2011-04-24  7:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, handa

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Kenichi Handa <handa@m17n.org>,  emacs-devel@gnu.org
> Date: Sun, 24 Apr 2011 02:02:59 -0300
> 
> > Rather than fix this function, I suggest deleting it.  It is not used
> 
> Off with their heads!

Done on the trunk.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-24  7:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-23 17:43 Remove char-direction Eli Zaretskii
2011-04-23 18:07 ` Drew Adams
2011-04-24  5:02 ` Stefan Monnier
2011-04-24  7:16   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).