From 0ec9914dd1933f10d975cf9be1eb1c063f5afb50 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 10 Mar 2006 19:29:56 +0000 Subject: [PATCH] muse-protocols: Add DOI handling. * lisp/muse-protocols.el (muse-url-protocols): Add handler for DOI's. DOI's (digitial object identifiers) are a standard identifier used in the publishing industry. Thanks to Phillip Lord for the patch. (muse-resolve-url-doi, muse-browse-url-doi): New functions that resolve and browse DOI's. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-53 --- AUTHORS | 10 ++++++---- ChangeLog.2006 | 17 +++++++++++++++++ lisp/muse-protocols.el | 21 ++++++++++++++++++++- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index dc9c590..ee51409 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,7 +9,7 @@ John Wiegley: Original author Michael Olson: Current maintainer Trent Buck: Contributor, - muse-latex.el: 4 lines changed. + muse-latex.el: 4 lines changed Sacha Chua: Contributor -- documentation (assigned past and future changes) @@ -35,13 +35,15 @@ Peter K. Lee: Contributor, (assigned past and future changes) Na Li: Contributor, - muse-latex2png.el: 1 line changed. + muse-latex2png.el: 1 line changed Phillip Lord: Contributor, - muse-colors.el: 3 lines changed. + muse-colors.el: 3 lines changed + muse-protocols: 3 lines changed + (assignment pending) Chris Lowis: Contributor, - muse-latex2png.el: 1 line changed. + muse-latex2png.el: 1 line changed Jim Ottaway: Contributor (assigned past and future changes) diff --git a/ChangeLog.2006 b/ChangeLog.2006 index 8e95d00..860e7ac 100644 --- a/ChangeLog.2006 +++ b/ChangeLog.2006 @@ -2,6 +2,23 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-03-10 19:29:56 GMT Michael Olson patch-53 + + Summary: + muse-protocols: Add DOI handling. + Revision: + muse--main--1.0--patch-53 + + * lisp/muse-protocols.el (muse-url-protocols): Add handler for DOI's. + DOI's (digitial object identifiers) are a standard identifier used in + the publishing industry. Thanks to Phillip Lord for the patch. + (muse-resolve-url-doi, muse-browse-url-doi): New functions that resolve + and browse DOI's. + + modified files: + AUTHORS ChangeLog.2006 lisp/muse-protocols.el + + 2006-03-10 16:34:52 GMT Michael Olson patch-52 Summary: diff --git a/lisp/muse-protocols.el b/lisp/muse-protocols.el index 1134d49..49674ed 100644 --- a/lisp/muse-protocols.el +++ b/lisp/muse-protocols.el @@ -1,6 +1,6 @@ ;;; muse-protocols.el --- URL protocols that Muse recognizes -;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -42,6 +42,9 @@ ;; Brad Collins (brad AT chenla DOT org) created the initial version ;; of this. +;; Phillip Lord (Phillip.Lord AT newcastle DOT ac DOT uk) provided a +;; handler for DOI URLs. + ;;; Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -75,6 +78,7 @@ This is autogenerated from `muse-url-protocols'.") ("telnet://" browse-url identity) ("wais://" browse-url identity) ("file://?" browse-url identity) + ("doi:" muse-browse-url-doi muse-resolve-url-doi) ("news:" browse-url identity) ("snews:" browse-url identity) ("mailto:" browse-url identity)) @@ -148,6 +152,21 @@ publishing or returns nil if not linked." (muse-update-url-regexp 'muse-url-protocols muse-url-protocols)) +(defun muse-resolve-url-doi (url) + "Return the URL through DOI proxy server." + (when (string-match "\\`doi:\\(.+\\)" url) + (concat "http://dx.doi.org/" + (match-string 1 url)))) + +(defun muse-browse-url-doi (url) + "If this is a DOI URL, browse it. + +DOI's (digitial object identifiers) are a standard identifier +used in the publishing industry." + (let ((doi-url (muse-resolve-url-doi url))) + (when doi-url + (browse-url doi-url)))) + (defun muse-resolve-url-google (url) "Return the correct Google search string." (when (string-match "\\`google:/?/?\\(.+\\)" url) -- 2.11.4.GIT