Skip to content

Commit

Permalink
(fix): dailies: prevent inclusion of non-org-roam files
Browse files Browse the repository at this point in the history
  • Loading branch information
juergenhoetzel committed Jan 28, 2021
1 parent fde40dc commit 96b36a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions org-roam-dailies.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
;;;; Declarations
(defvar org-roam-mode)
(defvar org-roam-directory)
(defvar org-roam-file-extensions)
(declare-function org-roam--org-file-p "org-roam")
(declare-function org-roam--find-file "org-roam")
(declare-function org-roam-mode "org-roam")
Expand Down Expand Up @@ -277,13 +278,14 @@ Prefer past dates, unless PREFER-FUTURE is non-nil."
(defun org-roam-dailies--list-files (&rest extra-files)
"List all files in `org-roam-dailies-directory'.
EXTRA-FILES can be used to append extra files to the list."
(let ((dir (org-roam-dailies-directory--get-absolute-path)))
(let ((dir (org-roam-dailies-directory--get-absolute-path))
(regexp (rx "." (eval `(or ,@org-roam-file-extensions)))))
(append (--remove (let ((file (file-name-nondirectory it)))
(when (or (auto-save-file-name-p file)
(backup-file-name-p file)
(string-match "^\\." file))
it))
(directory-files-recursively dir ""))
(directory-files-recursively dir regexp))
extra-files)))

(defun org-roam-dailies-find-next-note (&optional n)
Expand Down

0 comments on commit 96b36a6

Please sign in to comment.