Remove directory-dirs function
This is redundant with code that already exists in Emacs.
This commit is contained in:
parent
49d2ecb7ea
commit
ed2b1796ab
15
config.org
15
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.
|
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
|
#+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 ()
|
(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
|
(defvar org-agenda-files-function #'org-agenda-files-function
|
||||||
"The function to determine the org agenda files.")
|
"The function to determine the org agenda files.")
|
||||||
|
|
Loading…
Reference in a new issue