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: bidi-display-reordering is now non-nil by default Date: Fri, 05 Aug 2011 09:56:50 +0300 Message-ID: <83k4asny6l.fsf@gnu.org> References: <20110731.082721.451360942.wl@gnu.org> <20110731.085115.40009301.wl@gnu.org> <877h6yanje.fsf@fencepost.gnu.org> <878vre95g3.fsf@fencepost.gnu.org> <87fwlm7fam.fsf@fencepost.gnu.org> <87bowa7dza.fsf@fencepost.gnu.org> <877h6y7chn.fsf@fencepost.gnu.org> <831ux6cv5o.fsf@gnu.org> <87d3gpku3o.fsf@gnus.org> <834o1ypa2b.fsf@gnu.org> <87r550msns.fsf@maru.md5i.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1312527552 398 80.91.229.12 (5 Aug 2011 06:59:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 5 Aug 2011 06:59:12 +0000 (UTC) Cc: larsi@gnus.org, list-general@mohsen.1.banan.byname.net, emacs-devel@gnu.org To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 05 08:59:08 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 1QpEN5-0002VM-O4 for ged-emacs-devel@m.gmane.org; Fri, 05 Aug 2011 08:59:03 +0200 Original-Received: from localhost ([::1]:33144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpEN5-0001SN-7h for ged-emacs-devel@m.gmane.org; Fri, 05 Aug 2011 02:59:03 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpEN0-0001Qg-5z for emacs-devel@gnu.org; Fri, 05 Aug 2011 02:59:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpEMw-00056B-AN for emacs-devel@gnu.org; Fri, 05 Aug 2011 02:58:58 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:37346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpEMw-000562-3Q for emacs-devel@gnu.org; Fri, 05 Aug 2011 02:58:54 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LPG00D000HBB000@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Fri, 05 Aug 2011 09:58:52 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.94.185]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LPG00C860Q1Q7A0@a-mtaout22.012.net.il>; Fri, 05 Aug 2011 09:58:50 +0300 (IDT) In-reply-to: <87r550msns.fsf@maru.md5i.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:142899 Archived-At: > From: Michael Welsh Duggan > Cc: Lars Magne Ingebrigtsen , list-general@mohsen.1.banan.byname.net, emacs-devel@gnu.org > Date: Thu, 04 Aug 2011 23:41:27 -0400 > > Scenario: Say we are desirous of updating XML mode to protect the > neutral characters that make up tags so they don't end up in visually > confusing locations. This can be done by adding proper directional > codes in the right locations. I was not arguing for inserting directional control characters into a buffer that visits a file. If there are no such directional control characters in the file, it is a very bad idea for Emacs to insert them for display purposes: it will run a high risk of leaking those extra characters back to the file. Your questions all explain why this would be a bad idea. The current features of bidirectional display do not yet support display of structured files, such as XML or comments and strings in program files (the latter "mostly" works, but only by accident). Supporting XML and similar structured text will need additional features that are not yet there. I don't even have a clear idea yet of what such a features would be. Sorry. The only thing you can do with the current bidi support that should work is to cover each string that may need reordering with a display property whose value is that same string. If you carefully exclude from the string all the neutral characters that get in the way of the "normal" reordering, you should get the effect that you expect. (I think; I didn't actually try that.) The disadvantage of this is that _editing_ those strings will be complicated: you will need to intercept cursor motion command and use the `cursor' property a lot to let the user think the cursor can enter such a string. You will also need to recompute the display string each time its origin in the buffer is modified. That's tedious at best, but at least it has a chance to work well with the current infrastructure. I think. If you try this suggestion, and find it feasible, then perhaps it could be a basis for solving this problem, or even a large part of the solution.