-(use-package auto-compile
- :demand t
- :config
- (auto-compile-on-load-mode)
- (auto-compile-on-save-mode)
- (setq auto-compile-display-buffer nil
- auto-compile-mode-line-counter t
- auto-compile-source-recreate-deletes-dest t
- auto-compile-toggle-deletes-nonlib-dest t
- auto-compile-update-autoloads t)
- (add-hook 'auto-compile-inhibit-compile-hook
- 'auto-compile-inhibit-compile-detached-git-head))
-
-(use-package org
- :defer 1
- :config
- (setq org-src-tab-acts-natively t
- org-src-preserve-indentation nil
- org-edit-src-content-indentation 0
- org-email-link-description-format "Email %c: %s" ; %.30s
- org-highlight-latex-and-related '(entities)
- org-log-done 'time)
- (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
- (font-lock-add-keywords
- 'org-mode
- '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
- (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
- (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
- (4 '(:foreground "#c5c8c6") t))) ; title
- t)
- :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
- :hook ((org-mode . org-indent-mode)
- (org-mode . auto-fill-mode)
- (org-mode . flyspell-mode))
- :custom
- (org-latex-packages-alist '(("" "listings") ("" "color")))
- :custom-face
- '(org-block-begin-line ((t (:foreground "#5a5b5a" :background "#1d1f21"))))
- '(org-block ((t (:background "#1d1f21"))))
- '(org-latex-and-related ((t (:foreground "#b294bb")))))
-
-(use-package ox-latex
- :after ox
- :config
- (setq org-latex-listings 'listings
- ;; org-latex-prefer-user-labels t
- )
- (add-to-list 'org-latex-packages-alist '("" "listings"))
- (add-to-list 'org-latex-packages-alist '("" "color"))
- (add-to-list 'org-latex-classes
- '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
- ("\\paragraph{%s}" . "\\paragraph*{%s}")
- ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
- t))
-
-(use-package ox-beamer
- :after ox)
-
-(use-package orgalist
- :after message
- :hook (message-mode . orgalist-mode))
-
-(after! org
- (defvar amin-show-async-tangle-results nil
- "Keep *emacs* async buffers around for later inspection.")
-
- (defvar amin-show-async-tangle-time nil
- "Show the time spent tangling the file.")
-
- (defvar amin-async-tangle-post-compile "make ti"
- "If non-nil, pass to `compile' after successful tangle.")
-
- (defun amin/async-babel-tangle ()
- "Tangle org file asynchronously."
- (interactive)
- (let* ((file-tangle-start-time (current-time))
- (file (buffer-file-name))
- (file-nodir (file-name-nondirectory file))
- (async-quiet-switch "-q"))
- (async-start
- `(lambda ()
- (require 'org)
- (org-babel-tangle-file ,file))
- (unless amin-show-async-tangle-results
- `(lambda (result)
- (if result
- (progn
- (message "Tangled %s%s"
- ,file-nodir
- (if amin-show-async-tangle-time
- (format " (%.3fs)"
- (float-time (time-subtract (current-time)
- ',file-tangle-start-time)))
- ""))
- (when amin-async-tangle-post-compile
- (compile amin-async-tangle-post-compile)))
- (message "Tangling %s failed" ,file-nodir))))))))
-
-(add-to-list
- 'safe-local-variable-values
- '(eval add-hook 'after-save-hook #'amin/async-babel-tangle 'append 'local))