This is part of the Emacs Starter Kit.
Configuration for the eminently useful Org Mode.
Org-mode is for keeping notes, maintaining ToDo lists, doing project planning, and authoring with a fast and effective plain-text system. Org Mode can be used as a very simple folding outliner or as a complex GTD system or tool for reproducible research and literate programming.
For more information on org-mode check out worg, a large Org-mode wiki which is also implemented using Org-mode and git.
The latest version of yasnippets doesn’t play well with Org-mode, the following function allows these two to play nicely together
(defun yas/org-very-safe-expand ()
(let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
(add-hook 'org-mode-hook
(lambda ()
(local-set-key "\M-\C-n" 'outline-next-visible-heading)
(local-set-key "\M-\C-p" 'outline-previous-visible-heading)
(local-set-key "\M-\C-u" 'outline-up-heading)
;; table
(local-set-key "\M-\C-w" 'org-table-copy-region)
(local-set-key "\M-\C-y" 'org-table-paste-rectangle)
(local-set-key "\M-\C-l" 'org-table-sort-lines)
;; display images
(local-set-key "\M-I" 'org-toggle-iimage-in-org)
;; yasnippet (using the new org-cycle hooks)
(make-variable-buffer-local 'yas/trigger-key)
(setq yas/trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
(define-key yas/keymap [tab] 'yas/next-field)
))
The library of babel contains makes many useful functions available for use by code blocks in any emacs file. See the actual library-of-babel.org file for information on the functions, and see worg:library-of-babel for more usage information.
(org-babel-lob-ingest
(expand-file-name
"library-of-babel.org"
(expand-file-name
"babel"
(expand-file-name
"contrib"
(expand-file-name
"org"
(expand-file-name "src" dotfiles-dir))))))
By placing the doc/
directory in Org-mode at the front of the
Info-directory-list
we can be sure that the latest version of the
Org-mode manual is available to the info
command (bound to C-h i
).
(unless (boundp 'Info-directory-list)
(setq Info-directory-list Info-default-directory-list))
(setq Info-directory-list
(cons (expand-file-name
"doc"
(expand-file-name
"org"
(expand-file-name "src" dotfiles-dir)))
Info-directory-list))
This code defines the starter-kit-project
which is used to publish
the documentation for the Starter Kit to html.
(unless (boundp 'org-publish-project-alist)
(setq org-publish-project-alist nil))
(let ((this-dir (file-name-directory (or load-file-name buffer-file-name))))
(add-to-list 'org-publish-project-alist
`("starter-kit-documentation"
:base-directory ,this-dir
:base-extension "org"
:style "<link rel=\"stylesheet\" href=\"emacs.css\" type=\"text/css\"/>"
:publishing-directory ,this-dir
:index-filename "starter-kit.org"
:auto-postamble nil)))