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: Re: right-char and left-char Date: Thu, 06 Oct 2011 20:21:15 +0200 Message-ID: <83pqiagew4.fsf@gnu.org> References: <87k48it6g3.fsf@stupidchicken.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1317925289 16316 80.91.229.12 (6 Oct 2011 18:21:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2011 18:21:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 06 20:21:25 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 1RBsZM-0001tV-9y for ged-emacs-devel@m.gmane.org; Thu, 06 Oct 2011 20:21:20 +0200 Original-Received: from localhost ([::1]:60991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBsZL-0000i9-FI for ged-emacs-devel@m.gmane.org; Thu, 06 Oct 2011 14:21:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBsZI-0000i4-9Q for emacs-devel@gnu.org; Thu, 06 Oct 2011 14:21:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBsZH-0002fi-5t for emacs-devel@gnu.org; Thu, 06 Oct 2011 14:21:16 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:42279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBsZG-0002fc-Uy for emacs-devel@gnu.org; Thu, 06 Oct 2011 14:21:15 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LSN00D00PMHNZ00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Thu, 06 Oct 2011 20:21:12 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.91.138]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LSN00CHQPNBZGA0@a-mtaout22.012.net.il>; Thu, 06 Oct 2011 20:21:12 +0200 (IST) In-reply-to: <87k48it6g3.fsf@stupidchicken.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 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:144628 Archived-At: > From: Chong Yidong > Date: Thu, 06 Oct 2011 12:45:16 -0400 > > In the Emacs manual, the documentation for right-char says: > > `' > Move one character to the right (`right-char'). This moves one > character forward in text that is read in the usual left-to-right > direction, but one character _backward_ if the text is read > right-to-left, as needed for right-to-left scripts such as Arabic. > > But in fact, the directionality of right-char and left-char depends on > current-bidi-paragraph-direction. If you have RTL text embedded in LTR > paragraphs, like in the HELLO file, moves left while in the RTL > segment. This contradicts the manual description, which merely states > "if the text is read right-to-left". > > Which is the intended behavior? The intended behavior is what you see now in Emacs. The manual is correct for the important special case of the paragraph direction that coincides with the text direction. Most L2R text in the world is in L2R paragraphs and most R2L text is in R2L paragraphs, so the description covers most of the use cases. As for the less common use case you mention, yes, the description in the manual could mislead if read too literally; "text is read left-to-right" is intentionally vague to at least not be blatantly wrong. There was a long thread about this which started here: http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg00005.html In that thread, I explained the difficulties of describing the behavior clearly and concisely to someone who doesn't already know what is the expected behavior. (Basically, only users of R2L scripts will know what to expect.) If you can come up with a better (more accurate) description, please suggest it. I don't think referencing current-bidi-paragraph-direction is the way to do it, because it sounds wrong to describe such a simple and basic editing key through such a complex notion as base paragraph direction or by reference to an obscure internal function.