-
Notifications
You must be signed in to change notification settings - Fork 4
/
init_org_async.el
112 lines (105 loc) · 4.1 KB
/
init_org_async.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
;;; init_org_async.el --- Minimum init file for async org-mode -*- lexical-binding: t; -*-
;; Specify this file in `org-export-async-init-file'
;; Errors in async process can be examined using M-x org-export-stack
;;; Configure directories
(let ((default-directory "~/.emacs.d/elpa/"))
(normal-top-level-add-subdirs-to-load-path))
;;; Initialize packages so that they can be auto-loaded.
(package-initialize)
;;;
;;; No emacs-default autosave or backup
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save-Control.html
(setq auto-save-default nil)
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup.html
(setq make-backup-files nil)
;;;
;;; Configure org-mode
(add-to-list 'load-path
;; We need a wild card as a MELPA package keeps changing the folder name.
;; http://emacs.stackexchange.com/questions/9768/elisp-files-in-load-path-are-not-loaded-on-emacs-start
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Elements.html
(car (last (file-expand-wildcards "~/.emacs.d/elpa/org-plus-contrib*"))))
(require 'org)
(require 'org-ref)
;;; Load exporters
(require 'ox-beamer)
;; bold is bold not \alert{} (can appear as red text)
;; http://orgmode.org/worg/exporters/beamer/ox-beamer.html#export-filters
(defun my-beamer-bold (contents backend info)
(when (eq backend 'beamer)
(replace-regexp-in-string "\\`\\\\[A-Za-z0-9]+" "\\\\textbf" contents)))
(add-to-list 'org-export-filter-bold-functions 'my-beamer-bold)
;;
;;
;;; Enable languages
;; Org-Mode Evaluation of code disabled
;; https://github.com/syl20bnr/spacemacs/issues/7641
(org-babel-do-load-languages
'org-babel-load-languages
'((latex . t)
(R . t)
(python . t)
(ditaa . t)
(dot . t)
;; This does not work unless there is a slime buffer.
;; (lisp . t)
(emacs-lisp . t)
(shell . t)))
;;
;; Do not ask code execution confirmation
(setq org-confirm-babel-evaluate nil)
;; R interweaving code and results.
;; https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00785.html
(setq org-babel-R-command "R --silent --no-save")
;;
;; Org-mode: Source block doesn't respect parent buffer indentation
;; http://emacs.stackexchange.com/questions/9472/org-mode-source-block-doesnt-respect-parent-buffer-indentation
(setq org-src-preserve-indentation t)
(setq org-edit-src-content-indentation 0)
;;
;;
;;; Language specific settings
;;
;;; latex
;; PDF processing with correct bibtex handling
;; http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00791.html
;; %f: full file name
;; %b: file base name
;; %o: base directory
(setq org-latex-pdf-process
'("latexmk -f %f"))
;; Remove additional temporary files.
(setq org-latex-logfiles-extensions
(append '("dvi" "bbl") org-latex-logfiles-extensions))
;; Support jsarticle
(add-to-list 'org-latex-classes
'("jsarticle"
"\\documentclass[a4j]{jsarticle}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(add-to-list 'org-latex-classes
'("bxjsarticle"
"\\documentclass[a4paper,xelatex,ja=standard]{bxjsarticle}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
;; code highlight
(setq org-latex-listings 'minted)
(setq org-latex-minted-options
'(("frame" "lines")
("linenos" "false")))
;;
;;; R
(setq inferior-R-args "--no-restore-history --no-save ")
(setq ess-ask-for-ess-directory nil)
;;
;;; slime
;; This does not work unless there is a slime process already running (not possible in async).
;; https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01237.html
;; (setq org-babel-lisp-eval-fn #'sly-eval)
(setq inferior-lisp-program (executable-find "sbcl"))