From ed2b1796ab97e621dca973a5069834aa3158a4d4 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Fri, 8 Mar 2024 18:48:59 -0500 Subject: [PATCH] Remove directory-dirs function This is redundant with code that already exists in Emacs. --- config.org | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/config.org b/config.org index 879260e..4beb547 100644 --- a/config.org +++ b/config.org @@ -3087,20 +3087,9 @@ The ~org-agenda~ dispatcher is occasionally useful, but most of the time when I I have a lot of different subdirectories and groupings in my org directory, but unfortunately directories listed in ~org-agenda-files~ aren't checked recursively! We can solve this by creating a function ~org-agenda-files-function~ to return the agenda files, then advising Org to call that function before getting the agenda files. #+begin_src emacs-lisp -(defun directory-dirs (dir) - "Recursively find all subdirectories of DIR, ignoring dotfiles." - (let* ((dir (directory-file-name dir)) - (files (directory-files dir nil nil t)) - (dirs (list dir))) - (dolist (file files) - (unless (= (aref file 0) ?.) - (let ((file (concat dir "/" file))) - (when (file-directory-p file) - (appendq! dirs (directory-dirs file)))))) - dirs)) - (defun org-agenda-files-function () - (directory-dirs org-directory)) + (require 'find-lisp) + (find-lisp-find-files org-directory "\.org$")) (defvar org-agenda-files-function #'org-agenda-files-function "The function to determine the org agenda files.")