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 2/2] bibtex.el: Add support for DOI URLs. Date: Wed, 12 Jun 2013 00:41:35 +0200 Message-ID: <1501461.pyIrJfMsDi@descartes> References: <9b5b428bbf8cbf8590249081f69605cc82d0601b.1370990432.git.ruediger@c-plusplus.de> 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 1370990519 10095 80.91.229.3 (11 Jun 2013 22:41:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Jun 2013 22:41:59 +0000 (UTC) Cc: winkler@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 12 00:42:00 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 1UmXGJ-0005ZU-K6 for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2013 00:41:59 +0200 Original-Received: from localhost ([::1]:56069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXGJ-0004hY-83 for ged-emacs-devel@m.gmane.org; Tue, 11 Jun 2013 18:41:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXG8-0004hQ-9b for emacs-devel@gnu.org; Tue, 11 Jun 2013 18:41:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmXG0-0005NF-09 for emacs-devel@gnu.org; Tue, 11 Jun 2013 18:41:48 -0400 Original-Received: from ptmx.org ([178.63.28.110]:59345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXFz-0005Mn-Qb; Tue, 11 Jun 2013 18:41:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 30F5521632; Wed, 12 Jun 2013 00:41:39 +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 pgJ966LZroc4; Wed, 12 Jun 2013 00:41:36 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 85F61215FF; Wed, 12 Jun 2013 00:41:36 +0200 (CEST) User-Agent: KMail/4.10.3 (Linux/3.8.0-23-generic; KDE/4.10.3; x86_64; ; ) In-Reply-To: <9b5b428bbf8cbf8590249081f69605cc82d0601b.1370990432.git.ruediger@c-plusplus.de> 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:160360 Archived-At: 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-doi-server-url): New variable. (bibtex-generate-url-list): Add support for DOI URLs. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/textmodes/bibtex.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 6280e19..b498da9 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1223,8 +1223,20 @@ (defcustom bibtex-summary-function 'bibtex-summa= ry :type '(choice (const :tag "Default" bibtex-summary) (function :tag "Personalized function"))) =20 +(defcustom bibtex-doi-server-url (if (boundp 'org-doi-server-url) + org-doi-server-url + "http://dx.doi.org/") + "The URL of the DOI server." + :group 'bibtex + :version "24.4" + :type 'string) + (defcustom bibtex-generate-url-list - '((("url" . ".*:.*"))) + '((("url" . ".*:.*")) + (("doi" . "10\\.[0-9]+/.+") + ("doi" ".*" + (lambda (text) + (concat bibtex-doi-server-url text))))) "List of schemes for generating the URL of a BibTeX entry. These schemes are used by `bibtex-url'. =20 @@ -1261,6 +1273,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