unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
To: emacs-devel@gnu.org
Cc: winkler@gnu.org
Subject: [PATCH 2/2] bibtex.el: Add support for DOI URLs.
Date: Wed, 12 Jun 2013 00:41:35 +0200	[thread overview]
Message-ID: <1501461.pyIrJfMsDi@descartes> (raw)
In-Reply-To: <9b5b428bbf8cbf8590249081f69605cc82d0601b.1370990432.git.ruediger@c-plusplus.de>

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 <ruediger@c-plusplus.de>
---
 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




       reply	other threads:[~2013-06-11 22:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9b5b428bbf8cbf8590249081f69605cc82d0601b.1370990432.git.ruediger@c-plusplus.de>
2013-06-11 22:41 ` Rüdiger Sonderfeld [this message]
2013-06-13  2:50   ` [PATCH 2/2] bibtex.el: Add support for DOI URLs Roland Winkler
2013-06-13  4:31     ` [PATCH] " Rüdiger Sonderfeld
2013-06-25  9:19   ` [PATCH 2/2] " Roland Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501461.pyIrJfMsDi@descartes \
    --to=ruediger@c-plusplus.de \
    --cc=emacs-devel@gnu.org \
    --cc=winkler@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).