From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: patch for custom colored links in org-mode Date: Tue, 28 Jun 2016 16:46:21 +0200 Message-ID: <87twgdxtfm.fsf@saiph.selenimh> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHuHZ-0003XB-1i for emacs-orgmode@gnu.org; Tue, 28 Jun 2016 10:46:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHuHV-0004ha-MW for emacs-orgmode@gnu.org; Tue, 28 Jun 2016 10:46:33 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:43739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHuHV-0004hF-F2 for emacs-orgmode@gnu.org; Tue, 28 Jun 2016 10:46:29 -0400 In-Reply-To: (John Kitchin's message of "Sun, 26 Jun 2016 09:35:59 -0400") 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" To: John Kitchin Cc: org mode Hello, John Kitchin writes: > I tried this aproach to enable custom colored links in org-mode if an > org-link-type face is defined. If no face is applied, then it just gets > the default org-link face > > For example this will make all doi links red. > > (defface org-link-doi > `((t (:inherit org-link > :foreground "red"))) > "Color for doi links.") > > It seems to work pretty well for me. What do you think about making this > a feature in org-mode? This sounds like a good idea. Thank you for submitting it. However, I'm not convinced by the UI, i.e., creating a face specifically named to trigger the feature. As a user, it doesn't seem very natural to me. At first I thought it was better to extend `org-add-link-type' with a FACE definition, but we wouldn't have caught default link types. So, maybe it is more reasonable to create a new variable, e.g., `org-link-display-parameters', which would hold an alist between link types and property lists (or something else), e.g., ("doi" :face my-special-face :display full) ("special" :display path) Note that :display is a way to include your other idea about link visibility. Default value for :face and :display would be, respectively, `org-link' and `description'. Of course, we can also create two variables, one for the face, the other for the visibility. WDYT? Regards, -- Nicolas Goaziou