Move Org stuff to near the top of the file

This is so other areas can hook into it.
This commit is contained in:
Camden Dixie O'Brien 2021-01-01 00:00:30 +00:00
parent 627586ba9e
commit f9dfef7c24

View File

@ -74,6 +74,105 @@ needs to be set up to install them if they aren't already.
(add-hook 'prog-mode-hook 'fira-code-mode)
#+end_src
* Org-mode
I use a couple non-standard bits and pieces, but not a whole bunch. I
really like the =<s= to insert a source block thing (which was
deprecated); =org-tempo= brings that back.
#+begin_src emacs-lisp
(use-package org
:ensure org-plus-contrib
:config
(require 'org-tempo))
#+end_src
** Agenda
Set up a keybinding for [[help:org-agenda][org-agenda]] and tell it where to look. I
have a bunch of org documents making up a sort of wiki which I keep
under [[file:~/exo][~/exo]].
#+begin_src emacs-lisp
(define-key global-map (kbd "C-c a") 'org-agenda)
(setq org-agenda-files
(directory-files-recursively "~/exo" "\.org$"))
#+end_src
Log when tasks were marked =DONE=, just for graphs.
#+begin_src emacs-lisp
(setq org-log-done t)
#+end_src
I often want to see TODO items that aren't scheduled to decide on
something to do (if I've already done all the scheduled things), so
it's nice for [[help:org-agenda][org-agenda]] to have an option for that.
#+begin_src emacs-lisp
(setq org-agenda-custom-commands
'(("u" "Unscheduled tasks" tags "-SCHEDULED={.+}/!+TODO")))
#+end_src
** Source Blocks
Pressing tab inside a source block should indent appropriately for its
language.
#+begin_src emacs-lisp
(setq org-src-tab-acts-natively t)
#+end_src
=babel= lets us evaluate Org documents containing source blocks! I
currently only use it for this very file, so it's only turned on for
Emacs lisp.
#+begin_src emacs-lisp
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)))
#+end_src
** Exporting
*** HTML
=htmlize= is needed for decent HTML exporting, and there is no need
for all that stuff at the bottom.
#+begin_src emacs-lisp
(use-package htmlize)
(setq org-html-postamble nil)
#+end_src
*** LaTeX
Use =minted= (LaTeX package) to do syntax highlighting in code blocks:
#+begin_src emacs-lisp
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
#+end_src
=minted= actually calls =pygments= through the shell, which =pdflatex=
doesn't like; you have to tell it not to worry, and that everything is
going to be OK.
#+begin_src emacs-lisp
(setq org-latex-pdf-process
'("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
#+end_src
Also, I don't like Emacs' built-in PDF viewer, so open PDFs in [[https://mupdf.com/][MuPDF]] instead:
#+begin_src emacs-lisp
(eval-after-load "org"
'(progn
(setcdr (assoc "\\.pdf\\'" org-file-apps) "mupdf %s")))
#+end_src
* Magit
=magit= is truly a wonderful creation! Only deviations from defaults
@ -215,105 +314,6 @@ needs to be set up to install them if they aren't already.
(paredit-mode))))
#+end_src
* Org-mode
I use a couple non-standard bits and pieces, but not a whole bunch. I
really like the =<s= to insert a source block thing (which was
deprecated); =org-tempo= brings that back.
#+begin_src emacs-lisp
(use-package org
:ensure org-plus-contrib
:config
(require 'org-tempo))
#+end_src
** Agenda
Set up a keybinding for [[help:org-agenda][org-agenda]] and tell it where to look. I
have a bunch of org documents making up a sort of wiki which I keep
under [[file:~/exo][~/exo]].
#+begin_src emacs-lisp
(define-key global-map (kbd "C-c a") 'org-agenda)
(setq org-agenda-files
(directory-files-recursively "~/exo" "\.org$"))
#+end_src
Log when tasks were marked =DONE=, just for graphs.
#+begin_src emacs-lisp
(setq org-log-done t)
#+end_src
I often want to see TODO items that aren't scheduled to decide on
something to do (if I've already done all the scheduled things), so
it's nice for [[help:org-agenda][org-agenda]] to have an option for that.
#+begin_src emacs-lisp
(setq org-agenda-custom-commands
'(("u" "Unscheduled tasks" tags "-SCHEDULED={.+}/!+TODO")))
#+end_src
** Source Blocks
Pressing tab inside a source block should indent appropriately for its
language.
#+begin_src emacs-lisp
(setq org-src-tab-acts-natively t)
#+end_src
=babel= lets us evaluate Org documents containing source blocks! I
currently only use it for this very file, so it's only turned on for
Emacs lisp.
#+begin_src emacs-lisp
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)))
#+end_src
** Exporting
*** HTML
=htmlize= is needed for decent HTML exporting, and there is no need
for all that stuff at the bottom.
#+begin_src emacs-lisp
(use-package htmlize)
(setq org-html-postamble nil)
#+end_src
*** LaTeX
Use =minted= (LaTeX package) to do syntax highlighting in code blocks:
#+begin_src emacs-lisp
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
#+end_src
=minted= actually calls =pygments= through the shell, which =pdflatex=
doesn't like; you have to tell it not to worry, and that everything is
going to be OK.
#+begin_src emacs-lisp
(setq org-latex-pdf-process
'("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
#+end_src
Also, I don't like Emacs' built-in PDF viewer, so open PDFs in [[https://mupdf.com/][MuPDF]] instead:
#+begin_src emacs-lisp
(eval-after-load "org"
'(progn
(setcdr (assoc "\\.pdf\\'" org-file-apps) "mupdf %s")))
#+end_src
* Music Player
I use MPD because it is clearly the best way to play music; sometimes