From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: `C-b' is backward-char, `left' is left-char - why? Date: Thu, 02 Jun 2011 00:26:59 +0100 Message-ID: <82y61l16bg.fsf@gmail.com> References: <6F4054004B154CFB8E2753172D316C13@us.oracle.com> <4DE4F8D0.7010800@lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306971960 32661 80.91.229.12 (1 Jun 2011 23:46:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2011 23:46:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 02 01:45:57 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 1QRv6q-0005BZ-Oq for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2011 01:45:57 +0200 Original-Received: from localhost ([::1]:35865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRv6p-0002Us-MU for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2011 19:45:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRuou-0006Du-RT for emacs-devel@gnu.org; Wed, 01 Jun 2011 19:27:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRuor-0003xt-Cc for emacs-devel@gnu.org; Wed, 01 Jun 2011 19:27:24 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:48241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRuoq-0003x7-7S for emacs-devel@gnu.org; Wed, 01 Jun 2011 19:27:21 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QRuoo-0006wq-IA for emacs-devel@gnu.org; Thu, 02 Jun 2011 01:27:18 +0200 Original-Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 01:27:18 +0200 Original-Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 01:27:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 69 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) Cancel-Lock: sha1:UK3NtptNWGRKgsVTnWPbEwRl3I4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:140039 Archived-At: On Wed 01 Jun 2011, Eli Zaretskii wrote: >> From: Andy Moreton Date: Wed, 01 Jun 2011 >> 12:48:15 +0100 >> >> The help strings for 'left-char and 'backward-char could use some >> work. It is unclear which moves according to screen display order and >> which moves according to buffer character order. > > I don't feel a need to invest "some work" on the doc string of > `backward-char', because that function has not changed in ages, > certainly not now. If its doc string is unclear, then I wonder how did > we all manage to use it all these years. > > Of course, I don't object if someone wants to work on that doc string. Having not looked at these functions previously, I found the doc strings to be essentially the same for both of them, which was confusing. > Regarding `left-char' and `right-char', the doc string says: > > Depending on the bidirectional context, this may move either > backward or forward in the buffer. > > Believe it or not, but I tried to make it more precise for a long > time, and this is the best I could come up with. There's a slightly > different variant in the Emacs manual, maybe you will like it better. > But both are not 100% accurate, because explaining what exactly it > does would take a very long text that has no place in a doc string. Having looked at the manual, I think the description there of and does a better job of explaining what happens in bidi enabled text than the doc strings. Given that a negative argument produces movement in the opposite direction, I understand the difficulty of explaining things. > If, after playing with the function in bidirectional context, you have > suggestions for describing it better, please propose the change in the > doc string that you think would make it more clear. If I understand things correctly the for N=1 (or omitted): - forward-char moves forward one character in the buffer, which in right-to-left text moves backward one position on the screen. - right-char moves forward one position on the screen, which in right-to-left text moves backward one character in the buffer. - backward-char moves backward one character in the buffer, which in right-to-left text moves forward one position on the screen. - left-char moves backward one position on the screen, which in right-to-left text moves forward one character in the buffer. If so, is this attempt any better ? --8<---------------cut here---------------start------------->8--- (forward-char &optional N) Move point N characters forward (backward if N is negative). On reaching end or beginning of buffer, stop and signal error. Movement on the screen depends on the bidirectional context. Moving forward over left-to-right text moves to the right on the screen, but moving forward over right-to-left text moves _backward_ on the screen. This is in contrast with right-char, which see. --8<---------------cut here---------------end--------------->8--- AndyM