lang/org: general refactor; split init into hooks

lang/org's initialization process is now split up into hooks on
org-load-hook. This approach is cleaner and easier to customize. I also
removed the escape binding in org-agenda-mode-map, as the popup system
makes it redundant.
This commit is contained in:
Henrik Lissner
2018-01-08 20:38:46 -05:00
parent b57c2e2264
commit 6853196017
6 changed files with 48 additions and 30 deletions

View File

@@ -1,5 +1,7 @@
;;; lang/org/+capture.el -*- lexical-binding: t; -*-
(add-hook 'org-load-hook #'+org|init-capture)
;; Sets up two `org-capture' workflows that I like:
;;
;; 1. The traditional way: invoking `org-capture' directly (or through a
@@ -26,11 +28,11 @@
"* %u %?\n%i" :prepend t :kill-buffer t)))
(after! org
(defun +org|init-capture ()
(defvaralias 'org-default-notes-file '+org-default-notes-file)
(setq org-default-notes-file (expand-file-name +org-default-notes-file +org-dir)
+org-default-todo-file (expand-file-name +org-default-todo-file +org-dir))
+org-default-todo-file (expand-file-name +org-default-todo-file +org-dir))
(add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame)