diff --git a/core/core.el b/core/core.el index 57a05f75c..039cb2750 100644 --- a/core/core.el +++ b/core/core.el @@ -58,6 +58,10 @@ (format "%s/cache/%s" doom-private-dir (system-name)) "Hostname-based elisp temp directories") +(defconst doom-org-dir + (expand-file-name "~/org") + "Where to find org notes") + ;; window-system is deprecated. Not on my watch! (unless (boundp 'window-system) (defvar window-system (framep-on-display))) diff --git a/modules/module-org-crm.el b/modules/module-org-crm.el index bb4ac4dad..907e5cc24 100644 --- a/modules/module-org-crm.el +++ b/modules/module-org-crm.el @@ -2,7 +2,8 @@ (add-hook 'org-load-hook 'doom|org-crm-init) -(defvar org-directory-crm (expand-file-name "/crm/" org-directory)) +(defvar org-directory-crm (expand-file-name "/crm/" doom-org-dir) + "") (defun doom|org-crm-init () ;; (define-org-section! work "Work") diff --git a/modules/module-org-notes.el b/modules/module-org-notes.el index ef1353072..488a221ec 100644 --- a/modules/module-org-notes.el +++ b/modules/module-org-notes.el @@ -13,12 +13,14 @@ (add-hook 'org-load-hook 'doom|org-attach-init t) (add-hook 'org-load-hook 'doom|org-export-init t) -(defconst org-directory-notebook (f-expand "notes/" org-directory)) -(defconst org-default-notes-file (f-expand "inbox.org" org-directory-notebook)) +(defvar doom-org-notes-dir (f-expand "notes" doom-org-dir) + "The directory where the notes are kept") -(defvar org-attach-directory ".attach/") -(defvar org-export-directory (concat org-directory ".export")) -(defvar org-quicknote-directory (concat org-directory "Inbox/")) +(defvar doom-org-quicknote-dir (f-expand "inbox" doom-org-notes-dir) + "") + +(defvar doom-org-attachment-dir ".attach/" + "Where to store attachments (relative to current org file).") ;; Keep track of attachments (defvar-local doom-org-attachments-list '() @@ -32,7 +34,10 @@ ;; (defun doom|org-notebook-init () - (setq org-capture-templates + (setq org-default-notes-file (f-expand "inbox.org" doom-org-notes-dir) + org-attach-directory doom-org-attachment-dir + org-export-directory (concat org-directory ".export") + org-capture-templates '(;; TODO: New Note (note) ;; TODO: New Task (todo) ;; TODO: New vocabulary word @@ -68,7 +73,7 @@ ;; (doom-fix-unicode '("FontAwesome" 13) ? ? ? ? ? ? ? ?) ;; Drag-and-drop support (require 'org-download) - (setq-default org-download-image-dir org-attach-directory + (setq-default org-download-image-dir doom-org-attachment-dir org-download-heading-lvl nil org-download-timestamp "_%Y%m%d_%H%M%S") diff --git a/modules/module-org.el b/modules/module-org.el index 3f7d2836f..d723043a6 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -1,7 +1,5 @@ ;;; module-org.el --- -*- no-byte-compile: t; -*- -(defconst org-directory (expand-file-name "~/Notes/")) - (define-minor-mode evil-org-mode "Evil-mode bindings for org-mode." :init-value nil @@ -14,6 +12,8 @@ (add-hook 'org-load-hook 'doom|org-hacks t) (add-hook 'org-mode-hook 'doom|org-hook) +(defvaralias 'org-directory 'doom-org-dir) + ;; (defun doom|org-hook () (evil-org-mode +1) @@ -183,7 +183,7 @@ (pushnew 'org-is-agenda-file recentf-exclude) ;; Don't track attachments - (push (format "/%s.+$" (regexp-quote org-attach-directory)) recentf-exclude) + (push (format "/%s.+$" (regexp-quote doom-org-attachment-dir)) recentf-exclude) (push ".attach" projectile-globally-ignored-file-suffixes) ;; Remove highlights on ESC