From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: [PATCH] bibtex.el: Add support for DOI URLs. Date: Thu, 13 Jun 2013 06:31:25 +0200 Message-ID: <76176348.Ds77xyHNjy@descartes> References: <20921.13183.89795.368672@gargle.gargle.HOWL> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1371097900 25887 80.91.229.3 (13 Jun 2013 04:31:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Jun 2013 04:31:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Roland Winkler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 13 06:31:39 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UmzCF-0000oW-9J for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2013 06:31:39 +0200 Original-Received: from localhost ([::1]:51703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmzCE-0003Bs-U6 for ged-emacs-devel@m.gmane.org; Thu, 13 Jun 2013 00:31:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmzC9-0003Bj-Vx for emacs-devel@gnu.org; Thu, 13 Jun 2013 00:31:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmzC7-0005EP-Be for emacs-devel@gnu.org; Thu, 13 Jun 2013 00:31:33 -0400 Original-Received: from ptmx.org ([178.63.28.110]:58738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmzC7-0005E4-5I; Thu, 13 Jun 2013 00:31:31 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id D4F542166A; Thu, 13 Jun 2013 06:31:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TZXzCqBtFSxB; Thu, 13 Jun 2013 06:31:26 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 89B8921613; Thu, 13 Jun 2013 06:31:26 +0200 (CEST) User-Agent: KMail/4.10.3 (Linux/3.8.0-23-generic; KDE/4.10.3; x86_64; ; ) In-Reply-To: <20921.13183.89795.368672@gargle.gargle.HOWL> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160399 Archived-At: On Thursday 13 June 2013 12:50:39 Roland Winkler wrote: > Thanks. I believe this patch is a bit complicated. It depends on > whether org-mode is loaded before or after bibtex-mode. But this > can go straight into bibtex-generate-url-list (which the user can > customize if she doesn't like it; but I can only think of more > exotic reasons why this might be necessary). I simplified the patch according to your suggestion. -- 8< -----------------------------------------------------------------= --------- >8 -- Digital object identifier (DOI) are commonly used to provide persistent citations. Therefore it seems to be a good idea to provide default support for them in bibtex.el. * lisp/textmodes/bibtex.el (bibtex-generate-url-list): Add support for DOI URLs. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/textmodes/bibtex.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 6280e19..171f373 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1224,7 +1224,10 @@ (defcustom bibtex-summary-function 'bibtex-summa= ry (function :tag "Personalized function"))) =20 (defcustom bibtex-generate-url-list - '((("url" . ".*:.*"))) + '((("url" . ".*:.*")) + (("doi" . "10\\.[0-9]+/.+") + "http://dx.doi.org/%s" + ("doi" ".*" 0))) "List of schemes for generating the URL of a BibTeX entry. These schemes are used by `bibtex-url'. =20 @@ -1261,6 +1264,7 @@ (defcustom bibtex-generate-url-list (\"volume\" \".*\" 0) (\"pages\" \"\\`[A-Z]?[0-9]+\" 0)))" :group 'bibtex + :version "24.4" :type '(repeat (cons :tag "Scheme" (cons :tag "Matcher" :extra-offset 4 --=20 1.8.3