From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Pardo Subject: doi proxy , a test patch Date: Wed, 23 May 2012 13:54:40 +0200 Message-ID: <4FBCD000.7030104@lpn.cnrs.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040601080907040005030303" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXA9N-0006bg-Un for emacs-orgmode@gnu.org; Wed, 23 May 2012 07:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXA9L-0003iP-U9 for emacs-orgmode@gnu.org; Wed, 23 May 2012 07:54:45 -0400 Received: from zimbra.lpn.cnrs.fr ([193.48.163.23]:60353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXA9L-0003i0-OA for emacs-orgmode@gnu.org; Wed, 23 May 2012 07:54:43 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.lpn.cnrs.fr (Postfix) with ESMTP id 9101243401A for ; Wed, 23 May 2012 13:54:35 +0200 (CEST) Received: from zimbra.lpn.cnrs.fr ([127.0.0.1]) by localhost (zimbra.lpn.cnrs.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ND+fCDAr-RDZ for ; Wed, 23 May 2012 13:54:35 +0200 (CEST) Received: from [10.8.0.228] (unknown [10.8.0.228]) by zimbra.lpn.cnrs.fr (Postfix) with ESMTPSA id 1F4D643400F for ; Wed, 23 May 2012 13:54:35 +0200 (CEST) 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------040601080907040005030303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------040601080907040005030303 Content-Type: text/x-patch; name="org.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="org.el.diff" 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)))) --------------040601080907040005030303--