[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] bibtex.el: Add support for DOI URLs.
From: |
Rüdiger Sonderfeld |
Subject: |
[PATCH 2/2] bibtex.el: Add support for DOI URLs. |
Date: |
Wed, 12 Jun 2013 00:41:35 +0200 |
User-agent: |
KMail/4.10.3 (Linux/3.8.0-23-generic; KDE/4.10.3; x86_64; ; ) |
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üdiger Sonderfeld <address@hidden>
---
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-summary
:type '(choice (const :tag "Default" bibtex-summary)
(function :tag "Personalized function")))
+(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'.
@@ -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
--
1.8.3
- [PATCH 2/2] bibtex.el: Add support for DOI URLs.,
Rüdiger Sonderfeld <=