From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Bidirectional text and URLs Date: Sun, 30 Nov 2014 19:13:54 +0100 Message-ID: References: <87a93cngwv.fsf@uwakimon.sk.tsukuba.ac.jp> <837fyfml31.fsf@gnu.org> <874mtio7wh.fsf@uwakimon.sk.tsukuba.ac.jp> <83r3wml8kq.fsf@gnu.org> <83zjb9an0q.fsf@gnu.org> <831toka82r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1417371273 6896 80.91.229.3 (30 Nov 2014 18:14:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2014 18:14:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 30 19:14:27 2014 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 1Xv90t-0000ZD-Jh for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2014 19:14:27 +0100 Original-Received: from localhost ([::1]:51189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv90t-0002aJ-3s for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2014 13:14:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv90k-0002a1-DN for emacs-devel@gnu.org; Sun, 30 Nov 2014 13:14:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xv90f-0002HH-1x for emacs-devel@gnu.org; Sun, 30 Nov 2014 13:14:18 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:43316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv90e-0002HB-S5; Sun, 30 Nov 2014 13:14:12 -0500 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Xv90N-0001T1-Bo; Sun, 30 Nov 2014 19:13:55 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVHYXeew+kXGyJdfpwz Q1F2nscDAgNWmM19AAACWUlEQVQ4jWWTTXOjMAyGVez0HMblzjheziTCe1YdL+ckwvcO0/H//wkr O2Syzb4HGPSgD0syxIdC/CEggAm0jnHIojVvWoHGcQLQFOdXMBWPQE343wMQxce+AMU++aQJXgER 7cA3Ub+GCm6Ki7tFaF6AdorQoyNdv1c7bMB+K/CJT1EXS584bGD4Jg0A7MpBvjldcrYuio2cwv3h QzVRft1xYkxFFwj9AWPAuMQmH8QyAY7CGMgS2o9fk3cxfyVO0jxFdzBgj2fkk6QQDwVKQQlFvRWz pC8pBIS1CX0F9qTmXIs/pFY8pBU1VFxJva+l5xKo7dK1FRUA9oub+T3XQAI2Mdg1Y1x/51prazbS MQwCSIAEuopHW81tewf9esq7Gr67Z+lQw2AF2NP5kbc4YZBxF+Dm6dg+JE05Bxgh2Mz0BN1CDVCQ A1sBdmrugAl1nYJoKKA5FcB6cCBmHZVncAW8L0epHKKNBaAUbiTHyjYs2ERZ1khlFq2UZ6BxkYO7 6QZKw73UXKs24Jzn0N/kd+Xba/co2sBAied+AbWd7wlcMnN/e2t/qnqYU3/71+gqsCoZT8vT3LWh grMa2V8uT3A7LhUoxUbm9QT76/zZieUs65lYP1qbrnu0h4gj7FRnPI8y8EmP2k1vxucDFbBLBj3U +wxAeG1VPoBM0HsB3Mt9DiESSTLZYRQPaY/xsneIZQmS5HnPn6UqL+dIzMd778pjvoOdr+DZKBPy 2x2w8f4B5LWPD+ANJn5uyVLBHmBURo+Xc9pydHEDCuBCWrvQ90qhwtHG4Y8s9V/2WuQ28l2IFAAA AABJRU5ErkJggg== X-Now-Playing: Depeche Mode's _Some Great Reward_: "Somebody" X-Hashcash: 1:23:141130:emacs-devel@gnu.org::v+eYhagTItrr4wGc:0000000000000000000000000000000000000000008kW/ X-Hashcash: 1:23:141130:eliz@gnu.org::oL0ifJvgugpuY5jS:00001QLX0 In-Reply-To: <831toka82r.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 30 Nov 2014 19:53:32 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-MailScanner-ID: 1Xv90N-0001T1-Bo MailScanner-NULL-Check: 1417976035.56729@VLT0XqsdQYsTlt332jd2rA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:178533 Archived-At: Eli Zaretskii writes: > Let's clear up terminology first, OK? Thanks for the explanation. > To summarize: Latin characters are displayed left to right, even in > RTL paragraphs, while right-to-left characters are always displayed > right to left. Neutral characters (slash, period) take the direction > of the surrounding text. Right. > HTH It does, yes. > May I ask why you came up with the question? Because I was wondering whether my suggestion from yesterday (that we insert LRO/PDF characters into URLs if there is an LRO present in the buffer when recognising URLs) is at all feasible, and from your explanation, it seems like it would be. And it would not require reimplementing bidi.c in Lisp. I agreed with your objection that if we used such a scheme, then the discussion we're doing here would look pretty incomprehensible. However, thinking about it a bit more, this is really favouring meta-discussion over usage, and I think we should be leery of doing that. Here's my proposal again, fleshed out with examples, for the algorithms that recognise (and make buttons out of) URLs and the like in email (etc.) buffers: 1) If there are no right-to-left overrides in the buffer, then do nothing special. This will cover 99.996% of all buffers. 2) If there is an LRO in the buffer, then, after recognising an URL, it is further treated. * If it contains no strongly right-to-left characters, we just wrap it in an LRO/PDF pair. URLs like "http://myspace.com" will then be guaranteed to be displayed reading left-to-right. * If the URL is like http://=D7=90=D7=91=D7=92.=D7=93=D7=94=D7=95=D7=96=D7= =97=D7=98.=D7=A7=D7=95=D7=9D, we would segment the URL into strongly-left-to-right-with-weak-chars and strongly-right-to-left-with-weak-chars segments. We wrap each left-to-right-with-weak-chars in LRO/PDF pairs. For that URL, this would be LRO http:// PDF =D7=90=D7=91=D7=92.=D7=93=D7=94=D7=95=D7=96=D7=97=D7=98.= =D7=A7=D7=95=D7=9D=20 Emacs already exposes the weak/strong/LTR/RTL status of each character, so function to do this LRO/PDF insertion is trivial. It's like a seven-line Elisp function or something. >From what you say, sounds like it would make the display of these URLs acceptable for bidi readers, too -- this would be the normal display of these URLs, anyway. The only thing we're protecting the users from is shenaningans. And discussions like this, of course, since all the URLs would display "correctly". :-) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no