From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Bidirectional text and URLs Date: Fri, 28 Nov 2014 19:26:14 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87lhmu3l95.fsf@lifelogs.com> References: <87k32f4loc.fsf@lifelogs.com> <874mtj3y1k.fsf@lifelogs.com> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417220775 12440 80.91.229.3 (29 Nov 2014 00:26:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 00:26:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 29 01:26:09 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 1XuVrV-0004Sm-1k for ged-emacs-devel@m.gmane.org; Sat, 29 Nov 2014 01:26:09 +0100 Original-Received: from localhost ([::1]:46413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuVrU-0004U8-K2 for ged-emacs-devel@m.gmane.org; Fri, 28 Nov 2014 19:26:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuVrD-0004Ts-QJ for emacs-devel@gnu.org; Fri, 28 Nov 2014 19:25:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuVr9-0004Gl-8D for emacs-devel@gnu.org; Fri, 28 Nov 2014 19:25:51 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:53340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuVr9-0004G8-0y for emacs-devel@gnu.org; Fri, 28 Nov 2014 19:25:47 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XuVr6-0004FB-8g for emacs-devel@gnu.org; Sat, 29 Nov 2014 01:25:44 +0100 Original-Received: from c-98-229-61-72.hsd1.ma.comcast.net ([98.229.61.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2014 01:25:44 +0100 Original-Received: from tzz by c-98-229-61-72.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2014 01:25:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 67 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-61-72.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:+Ye+hvxJF0QUBafVn1q9k3woEnI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:178442 Archived-At: On Fri, 28 Nov 2014 16:02:02 -0500 Stefan Monnier wrote: >> For Gnus users, for instance, the buffer would be using SHR so there's >> some control over the experience and metadata about the content. You're >> right that in general this is not clear, which is why interactive >> functions like `browse-url' and others may need to be advised. SM> What I meant is that in the SHR case, the text displayed is not the URL SM> but some random piece of text that should be highlighted as a button SM> (although in some cases it is the same text as the URL itself, SHR has SM> no idea whether that's the case or not). SM> We can do something in the Gnus case rendering non-HTML contents, where SM> the URL is highlighted as a button, because at that point we do display SM> something which we know is supposed to be interpreted by the user as a URL. I see what you mean. You're right that it should be rendered differently, but there's too many ways the rendering can be modified by the buffer mode, so whatever SHR does will not be enough. Intercepting the `browse-url' action, on the other hand, is definitely going to interrupt the user in order to warn them, no matter how they got that URL. For rendering, I think some help from the core would be nice for modes that want it; see below about "markchars" and `prettify-symbols-mode' etc. On Sat, 29 Nov 2014 00:26:01 +0200 Eli Zaretskii wrote: >> From: Ted Zlatanov >> Date: Fri, 28 Nov 2014 14:49:59 -0500 >> >> I'm not sure about the bidi markers, Eli can discuss that side. I'll >> try to get the confusables in there and maybe write general code that >> bidi markers and others can hook into. EZ> I cannot say I can follow that. Those "bidi markers" are just EZ> characters, so how can they hook into something? Sorry, I meant "code that detects suspicious bidi markers" instead of "bidi markers." We have the "markchars" package in the GNU ELPA, which can currently highlight Unicode confusables and others with a special face (magenta underline by default). For confusables specifically, it just looks for more than one Unicode script within a word, so it's not exactly what Lars asked originally. There was an epic discussion about "markchars" back in 2011: http://comments.gmane.org/gmane.emacs.devel/122200 Anyhow, I was thinking of bringing something like "markchars" into the core and also making the "uni-confusables" package (which is just a conversion of the Unicode confusables.txt) available by default as a char-table. I'm not sure what it will look like, so if anyone can think of precedents, let me know. I think the `prettify-symbols-mode' approach is one possibility, and in fact it was just suggested recently that it should support regexps... any others? EZ> For that matter, what functionality are we talking about? >> >> The uni-confusables package from the GNU ELPA and glue code to let SHR >> and EWW know that a URL includes such characters. EZ> Once again, these characters are not confusables. Their use around EZ> the URL is. So highlighting them wherever we see them is not EZ> necessarily the best way. OK, understood. See above about rendering vs. interrupting UI flow. The latter is what Lars suggested and I agree is more useful. Ted