summaryrefslogtreecommitdiffstats
path: root/.emacs.d/site-lisp/org-init.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/site-lisp/org-init.el')
-rw-r--r--.emacs.d/site-lisp/org-init.el64
1 files changed, 41 insertions, 23 deletions
diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el
index 0894d8b..ff42043 100644
--- a/.emacs.d/site-lisp/org-init.el
+++ b/.emacs.d/site-lisp/org-init.el
@@ -62,11 +62,27 @@
(defun org-init-filter-by-desktop ()
"Filter agenda by current label."
(when desktop-dirname
- (let ((label (tagify (file-name-base
+ (let ((label (tagify (file-name-nondirectory
(directory-file-name
(expand-file-name desktop-dirname))))))
(org-agenda-filter-apply (cons label nil) 'tag))))
+(defun org-init-skip-tags ()
+ "Skip the \"ex\" and \"unconfirmed\" tags."
+ (let ((tags (org-entry-get (point) "TAGS")))
+ (when (and tags (string-match-p
+ (rx (and ":" (or "ex" "unconfirmed") ":")) tags))
+ (save-excursion
+ (org-forward-element)
+ (point)))))
+
+(defun org-init-get-tag-name ()
+ "Get the name for a new tag for the currently loaded desktop."
+ (let ((dname (desktop-registry-current-desktop)))
+ (if dname
+ (format ":%s:" (tagify dname))
+ "")))
+
(setq org-agenda-files '("~/documents/org/tasks"))
(setq org-agenda-cmp-user-defined (lambda (a b) 1))
@@ -86,19 +102,17 @@
(setq org-default-notes-file (concat org-directory "/org"))
(setq org-capture-templates
`(("t" "Task" entry (file "~/documents/org/tasks")
- "* TODO %? %(let ((dname (desktop-registry-current-desktop)))
- (if dname
- (concat \":\" dname \":\")
- \"\"))")
+ "* TODO %? %(org-init-get-tag-name)"
+ :empty-lines-before 1)
("T" "Linked task" entry (file "~/documents/org/tasks")
- "* TODO %? %(let ((dname (desktop-registry-current-desktop)))
- (if dname
- (concat \":\" dname \":\")
- \"\"))\n\n %a")
+ "* TODO %? %(org-init-get-tag-name)\n\n %a"
+ :empty-lines-before 1)
("a" "Appointment" entry (file "~/documents/org/tasks")
- "* %?\n %^T\n\n %a")
+ "* %?\n %^T\n\n %a"
+ :empty-lines-before 1)
("n" "General note" entry (file ,org-default-notes-file)
- (function oni:note-template))))
+ (function oni:note-template)
+ :empty-lines-before 1)))
(setq org-contacts-files '("~/documents/org/misc/contacts.org"))
(setq org-agenda-show-outline-path nil)
(setq org-agenda-todo-ignore-deadlines 'far)
@@ -119,20 +133,24 @@
(setq org-tags-column (- 70))
(setq org-tags-exclude-from-inheritance '("crypt"))
(setq org-todo-keyword-faces
- '(("TODO" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
- ("DONE" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335"))
- ("SUCCEEDED" :foreground "#9ad870" :background "#222224" :box (:width 1 :color "#333335"))
- ("WAITING" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830"))
- ("CANCELLED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335"))
- ("FAILED" :foreground "#93d8d8" :background "#222224" :box (:width 1 :color "#333335"))
- ("WIP" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
- ("HOLD" :foreground "#ffbb56" :background "#171719" :box (:width 1 :color "#282830"))
- ("ACQUIRE" :foreground "#ff756e" :background "#171719" :box (:width 1 :color "#282830"))
- ("IGNORED" :foreground "#999999" :background "#222224" :box (:width 1 :color "#333335"))
- ("COMMENT" :foreground "#969696" :background "#3d3d3d" :box (:line-width 2 :color "#3d3d3d"))))
+ '(("TODO" 'font-lock-constant-face)
+ ("HOLD" 'font-lock-keyword-face)
+ ("WIP" 'font-lock-variable-name-face)
+ ("REVIEW" 'font-lock-builtin-face)
+ ("DONE" 'font-lock-function-name-face)
+ ("CANCELLED" 'font-lock-comment-face)
+ ("FAILED" 'font-lock-type-face)
+ ("ACQUIRE" 'font-lock-constant-face)
+ ("IGNORED" 'font-lock-comment-face)
+ ("COMMENT" 'font-lock-comment-delimiter-face)
+ ("GOT" 'font-lock-function-name-face)))
(setq org-use-fast-todo-selection t)
-(setq org-agenda-skip-function-global 'oni:skip-ex-tag)
+(setq org-agenda-skip-function-global 'org-init-skip-tags)
(setq org-use-property-inheritance '("slug"))
+(setq org-M-RET-may-split-line '((default . t)
+ (headline)))
+(setq org-insert-heading-respect-content t)
+(setf (cdar org-blank-before-new-entry) t)
(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt)
(add-hook 'org-agenda-finalize-hook 'org-init-filter-by-desktop)