From 15cd08c8c148476c1c38be64bddd6ed5e276e1e7 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 24 Nov 2018 23:08:05 -0500 Subject: [PATCH] added actual org source files to conflict agenda view --- conf.org | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/conf.org b/conf.org index 3b6ec59..42e0616 100644 --- a/conf.org +++ b/conf.org @@ -1229,20 +1229,19 @@ entries from the TS-LIST." (defun nd/build-conflict-list () "Scan all org files and make a list of all timestamps that conflict." - (let ((files '("~/Org/reference/testconflict.org")) - prev-point ts-list cur-index conflicts) + (let ((files (org-agenda-files)) + max-reached ts-list cur-index conflicts) ;; get all timestamps from org buffers (dolist (f files ts-list) (with-current-buffer (find-file-noselect f) (goto-char (point-min)) - (if (not (outline-on-heading-p)) (outline-next-heading)) - (setq prev-point -1) - (while (> (point) prev-point) + (when (not (outline-on-heading-p)) (outline-next-heading)) + (setq max-reached nil) + (while (not max-reached) (let ((new-ts (nd/get-timestamps))) (if new-ts (setq ts-list (cons new-ts ts-list)))) - (setq prev-point (point)) - (outline-next-heading)))) + (unless (outline-next-heading) (setq max-reached t))))) ;; sort the timestamp list ;; TODO, need to make range-aware