From 8735e338f9ba07b53d3d62809877aba2774e8419 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 26 Jul 2011 01:18:41 +0200 Subject: [PATCH] Moved org-mode settings together --- emacs.d/functions.el | 4 --- emacs.el | 70 +++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/emacs.d/functions.el b/emacs.d/functions.el index 6dec89f..9035d34 100644 --- a/emacs.d/functions.el +++ b/emacs.d/functions.el @@ -185,10 +185,6 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (whitespace-mode) (auto-fill-mode)) -(defun on-org-mode () - (flyspell-mode 1) - (auto-fill-mode 1)) - (defun on-php-mode () (local-set-key [f6] 'comment-line)) diff --git a/emacs.el b/emacs.el index 97b0a89..0c52e51 100644 --- a/emacs.el +++ b/emacs.el @@ -22,6 +22,42 @@ (lambda () (set-column-markers 76 81))) +;; Org mode +(require 'org-crypt) +(require 'org-publish) +(setq + org-tags-exclude-from-inheritance '("crypt") + org-crypt-key "33E8CC1CC4" + org-use-fast-todo-selection t + org-default-notes-file (concat org-directory + "/notes.org") + org-outline-path-complete-in-steps t + org-return-follows-link t + org-log-into-drawer t + org-todo-keywords '((sequence "TODO(t)" + "IN PROGRESS(p)" + "WAITING(w@/!)" + "|" + "DONE(d!/!)" + "CANCELLED(c@/!)")) + org-refile-targets '((org-agenda-files :maxlevel . 5) + (nil :maxlevel . 5)) + org-todo-keyword-faces + '(("TODO" :foreground "red" :weight bold) + ("IN PROGRESS" :foreground "yellow" :weight bold) + ("DONE" :foreground "forest green" :weight bold) + ("WAITING" :foreground "orange" :weight bold) + ("CANCELLED" :foreground "orangered" :weight bold))) +(add-to-list 'auto-mode-alist '("\\.commitmsg$" . org-mode)) +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-cc" 'org-capture) +(global-set-key "\C-ca" 'org-agenda) +(add-hook 'org-mode-hook + (lambda () + (flyspell-mode t) + (auto-fill-mode t))) +(org-crypt-use-before-save-magic) + (add-to-list 'load-path "~/.emacs.d/elisp/markdown-mode") (add-to-list 'load-path "~/.emacs.d/elisp/git-commit-mode") (add-to-list 'load-path "~/.emacs.d/elisp/lua-mode") @@ -30,11 +66,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; REQUIRES ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(require 'org-crypt) (require 'rainbow-delimiters) (require 'uniquify) (require 'server) -(require 'org-publish) (require 'htmlize) (require 'git) @@ -87,19 +121,12 @@ (setq browse-url-generic-program (getenv "BROWSER")) (setq whitespace-style '(face trailing)) ; For use with markdown mode (setq uniquify-buffer-name-style 'reverse) -(setq org-tags-exclude-from-inheritance '("crypt")) -(setq org-crypt-key "33E8CC1CC4") -(setq org-use-fast-todo-selection t) -(setq org-default-notes-file (concat org-directory "/notes.org")) (setq jit-lock-defer-time 0.2) ; Don't fontlock immediately (setq htmlize-output-type 'inline-css) (setq ido-save-directory-list-file nil) (setq ido-auto-merge-delay-time 2) ; Wait before fixing names -(setq org-outline-path-complete-in-steps t) -(setq org-return-follows-link t) (setq mouse-autoselect-window t) (setq pop-up-windows nil) -(setq org-log-into-drawer t) (setq mail-header-separator "") (setq frame-title-format ; I don't like emacs@cloud, must have file @@ -115,25 +142,6 @@ (setq default-frame-alist ; default frame settings (append '((font . "DejaVu Sans Mono-10:antialias=true")))) -(setq org-todo-keywords - '((sequence "TODO(t)" - "IN PROGRESS(p)" - "WAITING(w@/!)" - "|" - "DONE(d!/!)" - "CANCELLED(c@/!)"))) - -(setq org-refile-targets - '((org-agenda-files :maxlevel . 5) - (nil :maxlevel . 5))) - -(setq org-todo-keyword-faces - '(("TODO" :foreground "red" :weight bold) - ("IN PROGRESS" :foreground "yellow" :weight bold) - ("DONE" :foreground "forest green" :weight bold) - ("WAITING" :foreground "orange" :weight bold) - ("CANCELLED" :foreground "orangered" :weight bold))) - (if window-system (x-init) (cli-init)) @@ -169,7 +177,6 @@ (add-to-list 'auto-mode-alist '("\\.css$" . css-mode)) (add-to-list 'auto-mode-alist '("stumpwmrc" . stumpwm-mode)) (add-to-list 'auto-mode-alist '("\\.go$" . go-mode)) -(add-to-list 'auto-mode-alist '("\\.commitmsg$" . org-mode)) (add-to-list 'auto-mode-alist '(".*mutt.*" . message-mode)) (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . git-commit-mode)) @@ -181,9 +188,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (global-set-key "\C-m" 'newline-and-indent) (global-set-key (kbd "C-x n r") 'narrow-to-region) -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-cc" 'org-capture) -(global-set-key "\C-ca" 'org-agenda) (global-set-key [f5] '(lambda () (interactive) (revert-buffer nil t nil))) @@ -201,7 +205,6 @@ (add-hook 'c-mode-hook 'on-c-mode) (add-hook 'html-mode-hook 'on-html-mode) (add-hook 'markdown-mode-hook 'on-markdown-mode) -(add-hook 'org-mode-hook 'on-org-mode) (add-hook 'php-mode-hook 'on-php-mode) (add-hook 'message-mode-hook 'on-mail-mode) (add-hook 'git-commit-mode-hook 'auto-fill-mode) @@ -303,7 +306,6 @@ "?>\n" '(indent-region (point-min) (point-max))) -(org-crypt-use-before-save-magic) (ad-activate 'server-create-window-system-frame) (add-php-keywords) (add-html-keywords)