Move Org mode config to init.org

This commit is contained in:
Tom Willemse 2017-12-29 10:54:00 -08:00
parent a494677ab2
commit fdb5495db2
3 changed files with 52 additions and 73 deletions

View file

@ -5,12 +5,15 @@ include ../../dotfiles.mk
AUTOLOADS_FILE = site-lisp/site-autoloads.el
UNWANTED = $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-%
SITE_LISPS = $(addsuffix c,$(filter-out $(UNWANTED),$(wildcard site-lisp/*.el)))
INIT_LISPS = $(addsuffix .elc,$(basename $(wildcard init/*.org)))
INIT_LISPS = init/oni-org-init.elc $(addsuffix .elc,$(basename $(wildcard init/*.org)))
VENDOR_DIRS = $(wildcard vendor-lisp/*)
.PHONE: all snippets
all: $(SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
init.el init/oni-org-init.el: init.org
$(call tangle,emacs-lisp)
%.el: %.org
$(call tangle,emacs-lisp)

View file

@ -1163,13 +1163,6 @@ Computing Environment".
(with-eval-after-load 'gnus (load "oni-gnus-init"))
#+END_SRC
- [[file:init/oni-org-init.org][Org]] :: Org is the craziest and most flexible organizational
application anyone's ever seen.
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'org (load "oni-org-init"))
#+END_SRC
- [[file:init/oni-eshell-init.org][Eshell]] :: The best shell on the planet.
#+BEGIN_SRC emacs-lisp
@ -1351,6 +1344,54 @@ Computing Environment".
(add-hook 'jabber-chat-mode-hook 'oni:set-default-directory)
#+END_SRC
** Org mode
:PROPERTIES:
:header-args: :tangle "init/oni-org-init.el"
:END:
Since Org mode is a big package and I end up customizing it /a lot/
I always keep its settings in a separate file since it might be
awhile before org-mode is loaded.
#+BEGIN_SRC emacs-lisp :tangle yes
(with-eval-after-load 'org (load "oni-org-init"))
#+END_SRC
To keep the byte-compiler from complaining, require any libraries
that are used by my configuration when this file is loaded.
#+BEGIN_SRC emacs-lisp
(require 'org)
(require 'org-bullets)
(require 'org-capture)
#+END_SRC
Fontify source code blocks in Org mode natively, meaning that they
should be fontified using the major mode specified in the source
block language.
#+BEGIN_SRC emacs-lisp
(setq org-src-fontify-natively t)
#+END_SRC
Follow the link at point when {{{key(RET)}}} is pressed.
#+BEGIN_SRC emacs-lisp
(setq org-return-follows-link t)
#+END_SRC
Automatically fill paragraphs while editing text.
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'auto-fill-mode)
#+END_SRC
Show pretty bullets instead of the default asterisk characters.
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'org-bullets-mode)
#+END_SRC
* Custom
Put the customize settings in a different file so that Emacs doesn't

View file

@ -1,65 +0,0 @@
#+TITLE: Org mode configuration
#+STARTUP: content
#+BEGIN_SRC emacs-lisp
(require 'org)
(require 'org-capture)
#+END_SRC
Tell org-mode to fontify code blocks in their specified languages.
#+BEGIN_SRC emacs-lisp
(setq org-src-fontify-natively t)
#+END_SRC
Pressing RET on a link should really follow that link.
#+BEGIN_SRC emacs-lisp
(setq org-return-follows-link t)
#+END_SRC
Enable automatic text filling for org-mode.
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'auto-fill-mode)
#+END_SRC
* Bullets
Show pretty bullets instead of the default asterisk characters.
** Load the contrib module
Org bullets isn't loaded when Org mode is by default, so I should
do that here.
#+BEGIN_SRC emacs-lisp
(require 'org-bullets)
#+END_SRC
** Enable bullets in Org mode
Enable =org-bullets-mode= whenever =org-mode= starts.
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'org-bullets-mode)
#+END_SRC
* Org protocol
Load org-protocol to let external applications add information to
org.
#+BEGIN_SRC emacs-lisp
(require 'org-protocol)
#+END_SRC
This template is used by Conkeror to capture a bookmark into my
bookmarks file.
#+BEGIN_SRC emacs-lisp
(add-to-list 'org-capture-templates
'("b" "Bookmark" entry (file "~/documents/org/bookmarks.org")
"* %c\n\n %i"
:empty-lines 1))
#+END_SRC