11

Org-mode offers a variety of different link types ([http], [file], [bibtex], [magit]...). However, they all get the same look defined by the face value for org-link.

Is it possible to e.g. change the background color depending on the type of link? So that http links would have a yellow background and file links a blue one?

  • Yes, it's possible, and there is probably more then one way to do it... but that's about all I can tell you :) Hopefully someone with more elisp skills then I have can write out a simple minor mode or something. – Brian Z Apr 26 '15 at 10:40
2

I would make this a comment, but I don't have enough rep so here goes:

Check out this function: org-activate-plain-links (in org.el).

You can modify the function around the 'add-text-properties', doing a match on each link using a cond for instance. I have student supervision now, but if you don't succeed in doing this, I'll add more information later.

0

See https://github.com/jkitchin/org-ref/blob/master/org-ref.el#L484

I use that code to change the appearance of links in org-ref using font lock at https://github.com/jkitchin/org-ref/blob/master/org-ref.el#L742

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.