From ef6dfade99a068153c6db0bf75d89f855d3b20c7 Mon Sep 17 00:00:00 2001 From: Random936 Date: Fri, 23 Feb 2024 07:24:09 -0800 Subject: [PATCH] Modified org-agenda-files to not include org-roam dailies files --- .emacs.d/org.org | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.emacs.d/org.org b/.emacs.d/org.org index ec30458..291ebad 100644 --- a/.emacs.d/org.org +++ b/.emacs.d/org.org @@ -156,7 +156,11 @@ Creates a function to refresh the ~org-agenda-files~ variable to be set to inclu #+begin_src emacs-lisp (defun jm/org-roam-refresh-agenda-list () (interactive) - (setq org-agenda-files (org-roam-list-files))) + (let ((directory (expand-file-name org-roam-dailies-directory org-roam-directory))) + (setq org-agenda-files + (seq-filter + (lambda (file-path) (not (s-starts-with-p directory file-path))) + (org-roam-list-files))))) #+end_src To use this function, I'll add it to some hooks to make sure to run it before the agenda list is needed. @@ -205,7 +209,7 @@ Before getting into the main config for Org-roam, I've created a few functions f #+begin_src emacs-lisp (defun jm/org-roam-find-filter (node) - (let* ((directory (expand-file-name org-roam-dailies-directory org-roam-directory))) + (let ((directory (expand-file-name org-roam-dailies-directory org-roam-directory))) (string= (file-name-directory (org-roam-node-file node)) directory))) @@ -225,10 +229,9 @@ Before getting into the main config for Org-roam, I've created a few functions f Below is the main config for org-roam. #+begin_src emacs-lisp - (use-package org-roam - :custom - (org-roam-directory (file-truename "~/Dropbox/org")) + :init (require 'org-roam-dailies) + :custom (org-roam-directory (file-truename "~/Dropbox/org")) :bind (("C-c n l" . org-roam-buffer-toggle) ("C-c n f" . jm/org-roam-find) ("C-c n d" . jm/org-roam-dailies-find) @@ -279,7 +282,6 @@ Below is the main config for org-roam. (setq org-roam-node-display-template (concat "${title:*} " (propertize "${file:*}" 'face 'org-tag))) - (require 'org-roam-dailies) (org-roam-db-autosync-mode)) #+end_src