org: change how paths are defined

This commit is contained in:
Henrik Lissner 2016-10-21 23:57:51 +02:00
parent 36781adb56
commit 5e8fa54b89
4 changed files with 21 additions and 11 deletions

View file

@ -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)))

View file

@ -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")

View file

@ -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")

View file

@ -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