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: Thu, 18 Aug 2011 19:14:38 +0300 Message-ID: <83k4aasnm9.fsf@gnu.org> References: <4E48D309.6050503@acdlabs.ru> <83hb5jujjs.fsf@gnu.org> <874o1j10zv.fsf@fencepost.gnu.org> <8362lyvcli.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1313684089 28023 80.91.229.12 (18 Aug 2011 16:14:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 18 Aug 2011 16:14:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 18 18:14:45 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 1Qu5Ex-0001N3-5U for ged-emacs-devel@m.gmane.org; Thu, 18 Aug 2011 18:14:43 +0200 Original-Received: from localhost ([::1]:60176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu5Ev-0005Rv-Vg for ged-emacs-devel@m.gmane.org; Thu, 18 Aug 2011 12:14:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu5Et-0005Re-CO for emacs-devel@gnu.org; Thu, 18 Aug 2011 12:14:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qu5Es-000848-8X for emacs-devel@gnu.org; Thu, 18 Aug 2011 12:14:39 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:50654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu5Er-00083y-JJ for emacs-devel@gnu.org; Thu, 18 Aug 2011 12:14:38 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LQ400600T0EZE00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Thu, 18 Aug 2011 19:14:35 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.126.221.230]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQ40063UT4A3NO0@a-mtaout23.012.net.il>; Thu, 18 Aug 2011 19:14:35 +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.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:143410 Archived-At: > From: Stefan Monnier > Date: Mon, 15 Aug 2011 14:13:21 -0400 > Cc: dak@gnu.org, emacs-devel@gnu.org > > And currently string-mark-left-to-right does the job just fine. In line with the above, does the following patch look like TRT? It is needed, e.g., when displaying completions for C-x C-f when some of the files in the directory end in R2L characters. Since we cover the TAB with a `(display (space :align-to ...))' property, which makes it a ``replacing'' display property, the underlying TAB loses its bidirectional properties and is reordered as if it were a neutral character. So instead of OOF RAB I see RAB OOF which shows the candidates in the wrong order, especially if completions-format is `vertical'. If this patch is okay, can you tell whether other completion facilities in Emacs might need similar changes? === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-08-15 16:10:39 +0000 +++ lisp/minibuffer.el 2011-08-18 13:07:52 +0000 @@ -1119,13 +1119,24 @@ It also eliminates runs of equal strings `(display (space :align-to ,column))) nil)))) (if (not (consp str)) - (put-text-property (point) (progn (insert str) (point)) + (put-text-property (point) + (progn + (insert (bidi-string-mark-left-to-right str)) + (point)) 'mouse-face 'highlight) - (put-text-property (point) (progn (insert (car str)) (point)) + (put-text-property (point) + (progn + (insert + (bidi-string-mark-left-to-right (car str))) + (point)) 'mouse-face 'highlight) - (add-text-properties (point) (progn (insert (cadr str)) (point)) + (add-text-properties (point) + (progn + (insert + (bidi-string-mark-left-to-right (cadr str))) + (point)) '(mouse-face nil - face completions-annotations))) + face completions-annotations))) (cond ((eq completions-format 'vertical) ;; Vertical format