forked from jkitchin/dft-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dft.el
60 lines (47 loc) · 1.84 KB
/
dft.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;; lisp code for dft-book
;;
;; sets up org-mode and the custom links
;;
;; sets up the dft-book menu
;; adapted from http://ergoemacs.org/emacs/elisp_menu.html
;; [[incar:keyword]]
;; this makes nice links in org-mode to the online documentation and
;; renders useful links in output
(require 'org)
(org-add-link-type "incar"
(lambda (keyword)
(browse-url
(format "http://cms.mpi.univie.ac.at/wiki/index.php/%s"
keyword)))
; this function is for formatting
(lambda (keyword link format)
(cond
((eq format 'html)
(format "<a href=http://cms.mpi.univie.ac.at/wiki/index.php/%s>%s</a>"
keyword keyword))
((eq format 'latex)
(format "\\href{http://cms.mpi.univie.ac.at/wiki/index.php/%s}{%s}"
keyword keyword)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Menu for dft-book
(defvar dft-book-mode-map
(let ((map (make-sparse-keymap)))
map)
"Keymap for dft-book-mode.")
(easy-menu-define dft-book-menu dft-book-mode-map "DFT-BOOK-MENU"
'("dft-book"
["VASP website" (browse-url "http://www.vasp.at/") t]
["VASP forum" (browse-url "http://cms.mpi.univie.ac.at/vasp-forum/forum.php") t]
["Get TODO agenda" (org-agenda "4" "t" "<") t]
["Exit" (progn (global-unset-key [menu-bar dft-book])
(kill-buffer "dft.org"))
t]))
(define-minor-mode dft-book-mode
"Minor mode for dft-book"
:lighter "dft"
:keymap dft-book-mode-map)
; some notes on what it might take to make EnableWrite/shell-escape globally true.
;C:\Users\jkitchin>initexmf --edit-config-file=miktex\config\pdflatex.ini
;C:\Users\jkitchin>initexmf --edit-config-file=miktex\config\pdflatex.ini
;C:\Users\jkitchin>initexmf --edit-config-file=miktex\config\latex.ini
;C:\Users\jkitchin>initexmf --edit-config-file=miktex\config\pdftex.ini