From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: refontifying links Date: Thu, 03 Dec 2015 19:46:47 +0000 Message-ID: <87610fb9i0.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4ZqB-0004Zd-Jx for emacs-orgmode@gnu.org; Thu, 03 Dec 2015 14:46:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Zq6-0002Ax-Kf for emacs-orgmode@gnu.org; Thu, 03 Dec 2015 14:46:55 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:37995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Zq6-0002Ab-EO for emacs-orgmode@gnu.org; Thu, 03 Dec 2015 14:46:50 -0500 Received: by wmec201 with SMTP id c201so37033511wme.1 for ; Thu, 03 Dec 2015 11:46:49 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin , emacs-orgmode Hi John, 2015ko azaroak 25an, John Kitchin-ek idatzi zuen: >=20 > Hi, >=20 > I am trying to find a nice way to change the color of some links. So far > the only solution I have found is to create a new face, and use > highlight-regexp to do it. >=20 > I would prefer to just use font-lock to change the color of the link. so > far I have not found a way to do that. >=20 > I have found the org-activate-plain-links, and org-font-lock-keywords > and the org-font-lock-hook, but so far have not figured out how to > overwrite the org-link face. >=20 > I am kind of looking for a general approach to fontifying here, but the > specific problem I want to solve is to be able to write: >=20 > [[color:Orangered1][Some text I want colored]] and have it show in my > buffer in Orangered1. >=20 > Any thoughts? Links are currently defined by an open function and an export function. It might be interesting if org added a third function to this set, a fontification function. OTOH we would have to consider if links are the best place to add this functionality. The work you have done on org-ref and other projects (which I greatly admire!) (ab)uses links as an analogue of HTML=E2=80=99s s= pan element: a way to encapsulate and attach attributes to a sub-paragraph-sized chunk of text whose semantics are somewhat amorphous. Your example here pushes that further, using the link for pure formatting: it no longer =E2=80=9Clinks=E2=80=9D to anything at all (a= nd thus probably should not have an associated open function nor be click-active in the buffer). I think =E2=80=9CSpans=E2=80=9D are something org should support, but not b= y co-opting links to do it. We ought to either make new syntax, or change the name of =E2=80=9Clinks=E2=80=9D to =E2=80=9Cspans=E2=80=9D and say the former ar= e a special case of the latter (preserving backwards compatibility of existing documents to the extent possible of course, but also doing our best to free ourselves of link-specific implementation details like percent-escaping). FWIW, HTH, Aaron PS I think if we had spans 2-3 years ago, then you would have used them to implement org-ref, and that code would already be in core. I think the same would be true of annotations, for which we=E2=80=99ve recently had= a well-responded thread with several code contribtions, including from you IIRC. On the other hand I don=E2=80=99t think we want org to become like L= atex, where almost all documents require a complicated web of third-party dependencies to =E2=80=9Cwork=E2=80=9D at all. It=E2=80=99s a delicate bal= ance... --=20 Aaron Ecay