From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Draft of links-9.0 Date: Tue, 05 Jul 2016 21:12:38 +0200 Message-ID: <87a8hvgaqh.fsf@saiph.selenimh> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKVm6-0003ev-6z for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 15:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKVm1-0004PJ-VL for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 15:12:50 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:46707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKVm1-0004Oq-Ni for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 15:12:45 -0400 In-Reply-To: (John Kitchin's message of "Tue, 05 Jul 2016 10:50:20 -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: "emacs-orgmode@gnu.org" Hello, John Kitchin writes: > I have completed a draft of links-9.0 > (https://github.com/jkitchin/org-mode/tree/link-9.0). This centralizes > almost all link properties into a variable `org-link-parameters' and > makes it possible to customize almost everything in the link. Thank you. > which also fail for me on master. There are about 27 commits from this > branch to master I think. I didn't make patches for all of them yet, > since that seemed like a bunch of them. This branch doesn't fix anything > in contrib yet (except the manual). I'm surprised there are so many of them. Anyway, it would be nice to display them here, for review. > I am pretty sure all the previous link behavior has been preserved, and > a lot of new things are possible with this. Below are some example uses. > Let me know what you think! > > * Example links > ** A basic link > Predefined links work the same as before. > > A doi:10.1021 link and [[doi:10.1021][bracketed version]]. > > This should look and act like it did before. > #+BEGIN_SRC emacs-lisp > (org-add-link-type > "test" nil nil) > #+END_SRC > > #+RESULTS: > : Created test link. > > A test:link and [[test:link][bracketed form]] > > ** A colored link with a static tooltip. > #+BEGIN_SRC emacs-lisp > (org-add-link-type > "red" > ;; follow > (lambda (path) (message "You clicked me.")) > ;; export > (lambda (path desc backend) > (cond > ((eq 'html backend) > (format "%s" > (or desc path))))) > :face '(:foreground "red") > :help-echo "Click me for a message.") > #+END_SRC Please do not extend `org-add-link-type': you are conflating two ways to set the same thing. It is better to create a new function, e.g., `org-link-add' with the following signature (defun org-link-add (type &rest properties) ...) used like (org-link-add "red" :follow (lambda (path desc backend) ...) :export ....) and keep `org-add-link-type' as a _deprecated_ function basically calling the previous one: (defun org-add-link-type (type &optional follow export) (org-link-add type :follow follow :export export)) Otherwise, it looks good. Regards, -- Nicolas Goaziou