Skip to content

Commit

Permalink
org setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Jun 19, 2022
1 parent 33abc5e commit cdcd4f5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
2 changes: 2 additions & 0 deletions lisp/init-elpa.el
Expand Up @@ -67,6 +67,7 @@
git-timemachine ; stable version is broken when git rename file
highlight-symbol
undo-fu
ob-sagemath
command-log-mode
evil ; @see https://github.com/emacs-evil/evil/commit/19cc5f8eef8bfffdec8082b604c7129782acb332
;; lsp-mode ; stable version has performance issue, but unstable version sends too many warnings
Expand Down Expand Up @@ -389,6 +390,7 @@ If NO-REFRESH is nil, `package-refresh-contents' is called."
(require-package 'ws-butler)
(require-package 'sage-shell-mode)
(require-package 'graphql-mode)
(require-package 'ob-sagemath)

(defvar my-color-themes
'(afternoon-theme
Expand Down
39 changes: 30 additions & 9 deletions lisp/init-org.el
Expand Up @@ -123,7 +123,7 @@ ARG is ignored."
(my-ensure 'org-re-reveal)

;; odt export
(add-to-list 'org-export-backends 'odt)
(push 'odt org-export-backends)

;; markdown export
(my-ensure 'ox-md)
Expand Down Expand Up @@ -164,7 +164,7 @@ ARG is ignored."
(apply orig-func args)))
(advice-add 'org-publish :around #'my-org-publish-hack)

;; {{ convert to odt
;; {{ convert from odt to other format (doc, pdf, ...)
(defun my-setup-odt-org-convert-process ()
(interactive)
(let* ((cmd "/Applications/LibreOffice.app/Contents/MacOS/soffice"))
Expand Down Expand Up @@ -192,13 +192,28 @@ ARG is ignored."
"xelatex -interaction nonstopmode -output-directory %o %f")) ;; org v8
;; }}

;; {{ org-babel
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(C . t)
(lisp . t)
(java . t)
(perl . t)
(latex . t)
(shell . t)
(lua . t)
(js . t)))
;; disable prompt when executing code block in org mode
(setq org-confirm-babel-evaluate nil)
;; }}

;; misc
(setq org-log-done t
org-completion-use-ido t
(setq org-log-done 'time
org-edit-src-content-indentation 0
org-edit-timestamp-down-means-later t
org-agenda-start-on-weekday nil
org-agenda-span 14
org-agenda-start-on-weekday nil ; start on the current day
org-agenda-include-diary t
org-agenda-window-setup 'current-window
org-fast-tag-selection-single-key 'expert
Expand All @@ -219,8 +234,14 @@ ARG is ignored."
org-outline-path-complete-in-steps nil
org-todo-keywords (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d!/!)")
(sequence "WAITING(w@/!)" "SOMEDAY(S)" "PROJECT(P@)" "|" "CANCELLED(c@/!)")))
org-imenu-depth 9
;; @see http://irreal.org/blog/1
org-src-fontify-natively t))
org-imenu-depth 9))

;; executing sage in org babel
(with-eval-after-load 'ob-sagemath
;; Ob-sagemath supports only evaluating with a session.
(setq org-babel-default-header-args:sage '((:session . t)
(:results . "drawer")))
(setq sage-shell:input-history-cache-file "~/data/sage_history")
(add-hook 'sage-shell-after-prompt-hook #'sage-shell-view-mode))

(provide 'init-org)
1 change: 1 addition & 0 deletions tests/my-byte-compile.el
Expand Up @@ -88,6 +88,7 @@
(require 'company-ispell)
(require 'company-ctags)
(require 'lsp-mode)
(require 'ob-sagemath)

(let ((files (find-lisp-find-files-internal
"."
Expand Down

0 comments on commit cdcd4f5

Please sign in to comment.