forked from jkitchin/org-ref
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nist-webbook.el
42 lines (33 loc) · 1.03 KB
/
nist-webbook.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;;; nist-webbook.el --- Integration of Emacs with NIST Webbook
;; Integration of Emacs with NIST webbook
;;; Commentary:
;; nist-webbook-name :: search for a chemical name
;; nist-webbook-formula :: search by chemical formula
;;; Code:
(require 'org)
(require 'org-ref-utils)
;;;###autoload
(defun nist-webbook-formula (formula)
"Search NIST webbook for FORMULA."
(interactive "sFormula: ")
(browse-url
(concat
"http://webbook.nist.gov/cgi/cbook.cgi?Formula="
formula
"&NoIon=on&Units=SI")))
;;;###autoload
(defun nist-webbook-name (name)
"Search NIST webbook for NAME."
(interactive "sChemical Name: ")
(browse-url
(concat "http://webbook.nist.gov/cgi/cbook.cgi?Name="
(url-hexify-string name)
"&Units=SI")))
(org-ref-link-set-parameters "nist-wb-name"
:follow (lambda (name)
(nist-webbook-name name)))
(org-ref-link-set-parameters "nist-wb-formula"
:follow (lambda (formula)
(nist-webbook-formula formula)))
(provide 'nist-webbook)
;;; nist-webbook.el ends here