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: Mon, 22 Aug 2011 09:02:48 +0300 Message-ID: <838vqmx9tj.fsf@gnu.org> References: <4E48D309.6050503@acdlabs.ru> <83hb5jujjs.fsf@gnu.org> <874o1j10zv.fsf@fencepost.gnu.org> <8362lyvcli.fsf@gnu.org> <83k4aasnm9.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1313992980 20346 80.91.229.12 (22 Aug 2011 06:03:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 22 Aug 2011 06:03:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 22 08:02:56 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 1QvNb5-0007Zg-4L for ged-emacs-devel@m.gmane.org; Mon, 22 Aug 2011 08:02:55 +0200 Original-Received: from localhost ([::1]:54991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvNb4-0000TM-Nd for ged-emacs-devel@m.gmane.org; Mon, 22 Aug 2011 02:02:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvNb1-0000TG-R9 for emacs-devel@gnu.org; Mon, 22 Aug 2011 02:02:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvNb0-00085T-OT for emacs-devel@gnu.org; Mon, 22 Aug 2011 02:02:51 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:60010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvNb0-00085G-IC for emacs-devel@gnu.org; Mon, 22 Aug 2011 02:02:50 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LQB00100F3CWG00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Mon, 22 Aug 2011 09:02:49 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.124.175.65]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQB00F5KFGLVF47@a-mtaout23.012.net.il>; Mon, 22 Aug 2011 09:02:46 +0300 (IDT) In-reply-to: <83k4aasnm9.fsf@gnu.org> 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:143492 Archived-At: Ping! > Date: Thu, 18 Aug 2011 19:14:38 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > 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 > > >