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 reordering in program source buffers (was: bidi-display-reordering is now non-nil by default) Date: Sat, 20 Aug 2011 13:53:29 +0300 Message-ID: <83wre84amu.fsf@gnu.org> References: <4E48D309.6050503@acdlabs.ru> <874o1j10zv.fsf@fencepost.gnu.org> <8362lyvcli.fsf@gnu.org> <87fwl2r0l4.fsf@stupidchicken.com> <83zkjatnkz.fsf@gnu.org> <877h6et8oi.fsf@stupidchicken.com> <83vctxua2y.fsf@gnu.org> <87r54le4rd.fsf@stupidchicken.com> <8362lxtfeb.fsf@gnu.org> <87d3g56llz.fsf@stupidchicken.com> <8339h0tur0.fsf@gnu.org> <87ippvwtwx.fsf@stupidchicken.com> <83liurruz4.fsf@gnu.org> <87k4aaej7f.fsf@stupidchicken.com> <83ippusjej.fsf@gnu.org> <87vctuz6eb.fsf@stupidchicken.com> <837h69sw0h.fsf@gnu.org> <87liuptbmp.fsf@stupidchicken.com> <83obzkqz2z.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1313837621 20821 80.91.229.12 (20 Aug 2011 10:53:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Aug 2011 10:53:41 +0000 (UTC) Cc: cyd@stupidchicken.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 20 12:53:37 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 1QujBI-0005JQ-Qw for ged-emacs-devel@m.gmane.org; Sat, 20 Aug 2011 12:53:36 +0200 Original-Received: from localhost ([::1]:44361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QujBI-0003o5-4A for ged-emacs-devel@m.gmane.org; Sat, 20 Aug 2011 06:53:36 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QujBF-0003iV-0R for emacs-devel@gnu.org; Sat, 20 Aug 2011 06:53:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QujBD-00047k-MS for emacs-devel@gnu.org; Sat, 20 Aug 2011 06:53:32 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QujBD-00047f-Ep for emacs-devel@gnu.org; Sat, 20 Aug 2011 06:53:31 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LQ800B003AC8I00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 20 Aug 2011 13:53:29 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.126.49.191]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQ8007P73L0IRU2@a-mtaout20.012.net.il>; Sat, 20 Aug 2011 13:53:29 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 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:143453 Archived-At: > From: Andreas Schwab > Cc: Chong Yidong , monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Sat, 20 Aug 2011 11:28:23 +0200 > > Eli Zaretskii writes: > > > And if we reorder it as a single L2R paragraph, we get this: > > > > printf ("FEDCBA %d\n", foo); > > > > which is a bit better, but still wrong. > > IMHO this is the correct way to display it. Consider when adding more > format directives, you must not reorder them so they still match the > order of arguments. Match the order on the screen or in the source file? The latter is not changed at all by reordering. As for the former, any bidi-aware format string should use directives with the parameter numbers explicitly specified with the n$ parameter ordinals, so the user looking at the result on the screen will know the correct order as a side effect. In general, having something like this on display: printf ("FEDCBA %d PONMLK %f ZYX %lu\n", foo, bar, baz); for a source that in logical order reads printf ("ABCDEF %d KLMNOP %f XYZ %lu\n", foo, bar, baz); which is what you suggest, is only marginally better than the original logical-order string, because the reading order is ambiguous at best, and downright undecipherable in more complex situations, where the format string includes punctuation and L2R text. So if we think the above is acceptable, we might as well consider not reordering this at all.