Re: [O] patch for custom colored links in org-mode

2016-07-06 Thread Rasmus
Nicolas Goaziou writes: > Hello, > > Rasmus writes: > >> Maybe a defcustom consisting of an alist of anonymous faces: >> >> '((R ((:background "red"))) >> (emacs-lisp ((:background "blue" > > Sounds good, even if a string as the key might be better (languages are > stored as strings in the

Re: [O] patch for custom colored links in org-mode

2016-07-03 Thread John Kitchin
Nicolas Goaziou writes: > John Kitchin writes: > >> I agree, it doesn't make sense to use it for customization. OTOH, it >> also adds the link type to org-link-types, rebuilds the regexp and the >> org-link-protocols. > > It is possible to rebuild regexps upon modifying a defcustom. Do you mean

Re: [O] patch for custom colored links in org-mode

2016-07-02 Thread Nicolas Goaziou
Hello, John Kitchin writes: > Would it make sense to use a defstruct for the link? I thought about that. Unfortunately, defstructs are not customize friendly. If we are going to give direct access to `org-link-parameters', i.e., make it a defcustom, this is not an option. > Then we get getters

Re: [O] patch for custom colored links in org-mode

2016-07-02 Thread John Kitchin
> > WDYT? > >> Presumably we would then eliminate the "org-%s-complete-link" >> functions? > > Indeed. > > I think it is possible to proceed in four steps. > > 1. First, we create the variable, with appropriate getter, setter and >default values. At this point it is sufficient to >support :

Re: [O] patch for custom colored links in org-mode

2016-07-01 Thread John Kitchin
If there is no urgency I will take a shot at it next week. I will look through the code and come up with a detailed plan that expands on your 4 steps below and be in touch about it. Thanks in advance for your patience 😉. On July 1, 2016, at 7:20 PM, Nicolas Goaziou wrote: John Kitchin writes:

Re: [O] patch for custom colored links in org-mode

2016-07-01 Thread Nicolas Goaziou
Hello, Rasmus writes: > Maybe a defcustom consisting of an alist of anonymous faces: > > '((R ((:background "red"))) > (emacs-lisp ((:background "blue" Sounds good, even if a string as the key might be better (languages are stored as strings in the parse tree). Also why limit ourselves to

Re: [O] patch for custom colored links in org-mode

2016-07-01 Thread Nicolas Goaziou
John Kitchin writes: > I agree, it doesn't make sense to use it for customization. OTOH, it > also adds the link type to org-link-types, rebuilds the regexp and the > org-link-protocols. It is possible to rebuild regexps upon modifying a defcustom. > Do you think we would eliminate `org-link-ty

Re: [O] patch for custom colored links in org-mode

2016-07-01 Thread John Kitchin
+1 for all this. Nicolas Goaziou writes: > Hello, > > John Kitchin writes: > >> Indeed, I based this approach off a patch Rasmus posted some time ago for >> colored blocks ;) >> >> It is also similar to some other approaches in org-mode, e.g. >> the "org-%s-complete-link" functions. > > This is

Re: [O] patch for custom colored links in org-mode

2016-07-01 Thread Nicolas Goaziou
Hello, John Kitchin writes: > Indeed, I based this approach off a patch Rasmus posted some time ago for > colored blocks ;) > > It is also similar to some other approaches in org-mode, e.g. > the "org-%s-complete-link" functions. This is yet another obscure part of Org, IMO. I really think we n

Re: [O] patch for custom colored links in org-mode

2016-06-30 Thread John Kitchin
I think I have attached the right patch that does this. Let me know what you think. Nicolas Goaziou writes: > Hello, > > John Kitchin writes: > >> I took a stab at this implementation here: >> >> https://github.com/jkitchin/org-mode/compare/master...colored-link-2?expand=1 > > Thank you. > > Co

Re: [O] patch for custom colored links in org-mode

2016-06-30 Thread Nicolas Goaziou
Hello, John Kitchin writes: > I took a stab at this implementation here: > > https://github.com/jkitchin/org-mode/compare/master...colored-link-2?expand=1 Thank you. Could you send the patch on the ML instead? It is better for commenting and archiving. Also make sure to patch against master br

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread John Kitchin
I took a stab at this implementation here: https://github.com/jkitchin/org-mode/compare/master...colored-link-2?expand=1 I wasn't too sure of the defcustom :type syntax. I also wasn't sure about this line https://github.com/jkitchin/org-mode/compare/master...colored-link-2?expand=1#diff-cfe1a32c

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread John Kitchin
That is also nice looking. Rasmus writes: > Nicolas Goaziou writes: > >> Hello, >> >> Rasmus writes: >> >>> Aside: This is what is done for specially colored source blocks. >> >> Duh. This totally eluded me. >> >>> But we can change that UI if you think. >> >> I think it would be nice to find

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread John Kitchin
Indeed, I based this approach off a patch Rasmus posted some time ago for colored blocks ;) It is also similar to some other approaches in org-mode, e.g. the "org-%s-complete-link" functions. I am ok with a single variable that is an a-list that combines face and display. Would you consider expa

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread Rasmus
Nicolas Goaziou writes: > Hello, > > Rasmus writes: > >> Aside: This is what is done for specially colored source blocks. > > Duh. This totally eluded me. > >> But we can change that UI if you think. > > I think it would be nice to find a decent UI for that feature, indeed. > With that naming co

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread Nicolas Goaziou
Hello, Rasmus writes: > Aside: This is what is done for specially colored source blocks. Duh. This totally eluded me. > But we can change that UI if you think. I think it would be nice to find a decent UI for that feature, indeed. With that naming convention rule, you get neither docstring no

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread Rasmus
Nicolas Goaziou writes: > 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. Aside: This is what is done for specially colored source blocks. But we can change that UI if you think. -- Send

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread Thomas S. Dye
Nicolas Goaziou writes: > 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. >> >> (

Re: [O] patch for custom colored links in org-mode

2016-06-28 Thread Nicolas Goaziou
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

Re: [O] patch for custom colored links in org-mode

2016-06-27 Thread Christian Wittern
Dear John, I was wishing for this feature for a couple of years and would very much like for this to become possible! While I do not exactly understand how you are doing it, if it works that should be good enough. Thanks a lot! Christian On 06/26/2016 10:35 PM, John Kitchin wrote: Hi all,

[O] patch for custom colored links in org-mode

2016-06-26 Thread John Kitchin
Hi all, 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 :foregrou