瀏覽代碼

Implement doi: links

Patch by Lennart Borgman.
Carsten Dominik 15 年之前
父節點
當前提交
a9539f449c
共有 4 個文件被更改,包括 10 次插入1 次删除
  1. 1 0
      doc/ChangeLog
  2. 1 0
      doc/org.texi
  3. 2 0
      lisp/ChangeLog
  4. 6 1
      lisp/org.el

+ 1 - 0
doc/ChangeLog

@@ -2,6 +2,7 @@
 
 	* org.texi (Conflicts): Document new work-around for windmove.el.
 	(Plain lists): Describe counter start cookies.
+	(External links): Add example for a doi link.
 
 2010-04-23  Carsten Dominik  <carsten.dominik@gmail.com>
 

+ 1 - 0
doc/org.texi

@@ -2806,6 +2806,7 @@ the colon.  The following list shows examples for each link type.
 
 @example
 http://www.astro.uva.nl/~dominik          @r{on the web}
+doi:10.1000/182                           @r{DOI for an electronic resource}
 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
 /home/dominik/images/jupiter.jpg          @r{same as above}
 file:papers/last.pdf                      @r{file, relative path}

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2010-04-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-link-types, org-open-at-point): Add doi links.
+
 	* org-ascii.el (org-export-ascii-preprocess): Remove list
 	startcounter cookies.
 

+ 6 - 1
lisp/org.el

@@ -4496,7 +4496,7 @@ The following commands are available:
 
 (defconst org-non-link-chars "]\t\n\r<>")
 (defvar org-link-types '("http" "https" "ftp" "mailto" "file" "news"
-			   "shell" "elisp"))
+			   "shell" "elisp" "doi"))
 (defvar org-link-types-re nil
    "Matches a link that has a url-like prefix like \"http:\"")
 (defvar org-link-re-with-space nil
@@ -8680,6 +8680,11 @@ application the system uses for this file type."
 	  (browse-url (concat type ":" (org-link-escape
 					path org-link-escape-chars-browser))))
 
+	 ((string= type "doi")
+	  (browse-url (concat "http://dx.doi.org/"
+                              (org-link-escape
+                               path org-link-escape-chars-browser))))
+
 	 ((member type '("message"))
 	  (browse-url (concat type ":" path)))