@@ -45,9+45,9 @@ The principle commands you will use from here are:
#+END_SRC
* Getting pdf files from a DOI
#+END_SRC
* Getting pdf files from a DOI
-The idea here is simple. When you visit http://dx.doi.org/doi, you get redirected to the journal site. Once you have the url for the article, you can usually compute the url to the pdf, or find it in the page. Then you simply download it.
+The idea here is simple. When you visit http://dx.doi.org/doi, you get redirected to the journal site. Once you have the url for the article, you can usually compute the url to the pdf, or find it in the page. Then you simply download it.
-There are some subtleties in doing this that are described here. To get the redirect, we have to use url-retrieve, and a callback function. The callback does not return anything, so we communicate through global variables. url-retrieve is asynchronous, so we have to make sure to wait for it to finish.
+There are some subtleties in doing this that are described here. To get the redirect, we have to use url-retrieve, and a callback function. The callback does not return anything, so we communicate through global variables. url-retrieve is asynchronous, so we have to make sure to wait for it to finish.
#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
(defvar *doi-utils-waiting* t
#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
(defvar *doi-utils-waiting* t
@@ -76,8+76,8 @@ To actually get the redirect we use url-retrieve like this.
;; we are going to wait until the url-retrieve is done
(setq *doi-utils-waiting* t)
;; start with no redirect. it will be set in the callback.
;; we are going to wait until the url-retrieve is done
(setq *doi-utils-waiting* t)
;; start with no redirect. it will be set in the callback.
- (setq *doi-utils-redirect* nil)
- (url-retrieve
+ (setq *doi-utils-redirect* nil)
+ (url-retrieve
(format "http://dx.doi.org/%s" doi)
'doi-utils-redirect-callback)
; I suspect we need to wait here for the asynchronous process to
(format "http://dx.doi.org/%s" doi)
'doi-utils-redirect-callback)
; I suspect we need to wait here for the asynchronous process to