summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-12-09 16:26:22 -0500
committerKyle Meyer <kyle@kyleam.com>2018-12-09 16:26:22 -0500
commit2583d4f206222f385949a676498d9b6296c261ab (patch)
treeff481f43618c3605979b72e31453ca3881770fa9
parentc321eac9eec299952c14b85969d67520806d020d (diff)
downloademacs.d-2583d4f206222f385949a676498d9b6296c261ab.tar.gz
agenda: Restructure notes directory
Set org-agenda-files to a file with a list of agenda files rather than setting org-agenda-files to a directory with symlinked org files.
-rw-r--r--init.el6
-rw-r--r--lisp/km-org-agenda.el24
2 files changed, 3 insertions, 27 deletions
diff --git a/init.el b/init.el
index ff8da8e..742131c 100644
--- a/init.el
+++ b/init.el
@@ -138,7 +138,7 @@
org-goto-interface 'outline-path-completionp
org-goto-max-level 3)
- (setq org-default-notes-file "~/notes/agenda/tasks.org")
+ (setq org-default-notes-file "~/notes/tasks.org")
(setq org-agenda-text-search-extra-files
(file-expand-wildcards "~/notes/extra/*.org"))
@@ -385,8 +385,8 @@
#'km/org-agenda-set-restriction-lock))
:config
- (setq km/org-agenda-file-directory "~/notes/agenda/"
- org-agenda-files (list km/org-agenda-file-directory))
+ (setq org-directory "~/notes/")
+ (setq org-agenda-files "~/notes/agenda-files")
(add-hook 'org-agenda-finalize-hook #'km/org-agenda-cd-and-read-dir-locals)
(add-hook 'org-agenda-finalize-hook #'km/org-agenda-store-current-span)
diff --git a/lisp/km-org-agenda.el b/lisp/km-org-agenda.el
index 30b6c49..dbbcabd 100644
--- a/lisp/km-org-agenda.el
+++ b/lisp/km-org-agenda.el
@@ -23,8 +23,6 @@
(require 'org-agenda)
(require 'km-org)
-(defvar km/org-agenda-file-directory nil)
-
(defun km/org-agenda-cd-and-read-dir-locals ()
(unless (get 'org-agenda-files 'org-restrict)
(setq default-directory (expand-file-name "~/notes/"))
@@ -38,28 +36,6 @@ killed."
(setq org-agenda-span org-agenda-current-span)))
;;;###autoload
-(defun km/org-agenda-add-or-remove-file (file)
- "Add or remove link to FILE in `km/org-agenda-file-directory'.
-If a link for FILE does not exist, create it. Otherwise, remove
-it. Like `org-agenda-file-to-front', this results in FILE being
-displayed in the agenda."
- (interactive (list (cl-case major-mode
- (org-mode (buffer-file-name))
- (dired-mode (dired-get-filename))
- (org-agenda-mode (ignore-errors (save-window-excursion
- (org-agenda-goto)
- (buffer-file-name))))
- (t (read-file-name "Link file: ")))))
- (let ((agenda-file (expand-file-name (file-name-nondirectory file)
- km/org-agenda-file-directory)))
- (if (file-equal-p (file-truename agenda-file) file)
- (progn
- (when (called-interactively-p) (message "Deleting %s" agenda-file))
- (delete-file agenda-file))
- (when (called-interactively-p) (message "Adding %s" agenda-file))
- (make-symbolic-link file agenda-file))))
-
-;;;###autoload
(defun km/org-open-default-notes-file-inbox ()
"Open \"Inbox\" heading of `org-default-notes-file'."
(interactive)