From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: doi proxy , a test patch Date: Wed, 23 May 2012 22:09:34 +0530 Message-ID: <81vcjm6ed5.fsf@gmail.com> References: <4FBCD000.7030104@lpn.cnrs.fr> <8162bnaxq0.fsf@gmail.com> <4FBCE041.8030705@christianmoe.com> <4FBCFE65.6080504@lpn.cnrs.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXEbM-0001cu-EO for emacs-orgmode@gnu.org; Wed, 23 May 2012 12:40:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXEbH-0007zJ-55 for emacs-orgmode@gnu.org; Wed, 23 May 2012 12:39:55 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:39128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXEbG-0007yD-SO for emacs-orgmode@gnu.org; Wed, 23 May 2012 12:39:51 -0400 Received: by pbbrp2 with SMTP id rp2so10763355pbb.0 for ; Wed, 23 May 2012 09:39:48 -0700 (PDT) In-Reply-To: <4FBCFE65.6080504@lpn.cnrs.fr> (Fabrice Pardo's message of "Wed, 23 May 2012 17:12:37 +0200") 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: Fabrice Pardo Cc: emacs-orgmode@gnu.org I know nothing about doi services. From what you say, the proxy servers are not inter-changeable. For the sake of argument - Can a given Org document contain links to two different doi proxies? In that case will a defcustom help. Fabrice Pardo writes: > Does it really achieve the same effect ? > Don't you need to use double square bracket > eg [[doi:10.1016/j.jphysparis.2011.09.011]] > instead of doi:10.1016/j.jphysparis.2011.09.011 ? > > If I'm wrong please correct me, I'm a newbie. > > My proposal is to customize the already defined doi External link, > which was hardcoded in org-open-at-point function. > > > On 12-05-23 03:04 PM, Christian Moe wrote: >> I think so. >> >> I find DOI links simplify life a great deal in any case: >> >> (setq org-link-abbrev-alist >> '(("doi" . "http://dx.doi.org/"))) >> >> e.g. doi:10.1016/j.jphysparis.2011.09.011 >> >> (Simply replace "dx.doi.org" with any privileged access point your >> institution might have) >> >> Yours, >> Christian >> >> On 5/23/12 2:27 PM, Jambunathan K wrote: >>> >>> Is there a way one can avoid the defcustom and achieve the same effect >>> using link abbreviations? I don't know. >>> >>> (info "(org) Link abbreviations") >>> >>> >>> Fabrice Pardo writes: >>> >>>> Hi, >>>> >>>> My institution library permits direct access to abstracts >>>> with pdf contents if we access to article through an address like >>>> http://dx.doi.org.my.instituti.on/... instead of http://dx.doi.org/... >>>> >>>> In the attached patch, I have defined a new variable org-doi-proxy >>>> which can be customized by the user. >>>> >>>> diff --git a/lisp/org.el b/lisp/org.el >>>> index 05f5375..c5d17a9 100644 >>>> --- a/lisp/org.el >>>> +++ b/lisp/org.el >>>> @@ -1838,6 +1838,10 @@ For more examples, see the system specific >>>> constants >>>> (string :tag "Command") >>>> (sexp :tag "Lisp form"))))) >>>> >>>> +(defcustom org-doi-proxy "http://dx.doi.org/" >>>> + "The doi proxy" >>>> + :group 'org-link-follow >>>> + :type 'string) >>>> >>>> >>>> (defgroup org-refile nil >>>> @@ -9714,7 +9718,7 @@ application the system uses for this file type." >>>> path)))) >>>> >>>> ((string= type "doi") >>>> - (browse-url (concat "http://dx.doi.org/" (if (org-string-match-p >>>> "[[:nonascii:] ]" path) >>>> + (browse-url (concat org-doi-proxy (if (org-string-match-p >>>> "[[:nonascii:] ]" path) >>>> (org-link-escape >>>> path org-link-escape-chars-browser) >>>> path)))) >>>> >>> >> > > > --