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: a strict visual cursor in r2l and l2r buffers Date: Sat, 29 Jun 2013 16:50:13 +0300 Message-ID: <83bo6pdo16.fsf@gnu.org> References: <87fvwa5ayg.fsf_-_@mat.ucm.es> <83ip15lric.fsf@gnu.org> <87mwqglrty.fsf@mat.ucm.es> <831u7slqp2.fsf@gnu.org> <8738s8lije.fsf@mat.ucm.es> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1372513820 19473 80.91.229.3 (29 Jun 2013 13:50:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Jun 2013 13:50:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Uwe Brauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 29 15:50:20 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsvXg-0001Ej-F9 for ged-emacs-devel@m.gmane.org; Sat, 29 Jun 2013 15:50:20 +0200 Original-Received: from localhost ([::1]:49771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsvXg-0000lY-5c for ged-emacs-devel@m.gmane.org; Sat, 29 Jun 2013 09:50:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsvXc-0000lF-3l for emacs-devel@gnu.org; Sat, 29 Jun 2013 09:50:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsvXb-0002yL-1j for emacs-devel@gnu.org; Sat, 29 Jun 2013 09:50:16 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:50794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsvXa-0002y6-Pc for emacs-devel@gnu.org; Sat, 29 Jun 2013 09:50:14 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MP500F00Q4HQ200@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Sat, 29 Jun 2013 16:50:13 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MP500FAIQFOK3A0@a-mtaout23.012.net.il>; Sat, 29 Jun 2013 16:50:13 +0300 (IDT) In-reply-to: <8738s8lije.fsf@mat.ucm.es> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.175 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:161272 Archived-At: > From: Uwe Brauer > Cc: emacs-devel@gnu.org > Date: Sun, 23 Jun 2013 21:43:33 +0200 > > >> > It's possible, just not trivial. Patches are welcome. > >> Lisp or C? > > > Whatever you like (although I think doing this is Lisp will be very > > inelegant, if not next to impossible). > > Oops unfortunately my C knowledge is not very deep and I asked to see > whether it could be done in lisp, the your answer seems to indicate: > impracticable. I decided it was high time for Emacs to have visual-order cursor motion. So trunk revision 113221 implements that, please try it (by customizing the new option visual-order-cursor-movement). When that option is non-nil, arrow keys will move in strict visual order. The feature still has some rough edges in some complicated situations, but C-f or C-b or C-n/C-p should provide a fire escape in those cases. And before everybody and their dog run to customize that option, let me tell you that it will make absolutely no difference, except unearthing some exciting new bugs, as long as you edit strict left-to-right text (because in that case, the screen order and the buffer order coincide). It only makes sense to customize this option to a non-nil value if you routinely need to work with bidirectional text. Note that text selection is still done in logical order (and should continue to be so, if you ask me), even when this new option is non-nil. Therefore, shifted arrow keys move in visual order, but select text in logical order, which could cause surprising effects wrt the highlighted portions of text. (Microsoft Word disables visual-order cursor motion if Shift is pressed, but I consider that a misfeature.) Enjoy.