added actual org source files to conflict agenda view

This commit is contained in:
ndwarshuis 2018-11-24 23:08:05 -05:00
parent 6f404d8eb4
commit 15cd08c8c1
1 changed files with 6 additions and 7 deletions

View File

@ -1229,20 +1229,19 @@ entries from the TS-LIST."
(defun nd/build-conflict-list () (defun nd/build-conflict-list ()
"Scan all org files and make a list of all timestamps that conflict." "Scan all org files and make a list of all timestamps that conflict."
(let ((files '("~/Org/reference/testconflict.org")) (let ((files (org-agenda-files))
prev-point ts-list cur-index conflicts) max-reached ts-list cur-index conflicts)
;; get all timestamps from org buffers ;; get all timestamps from org buffers
(dolist (f files ts-list) (dolist (f files ts-list)
(with-current-buffer (with-current-buffer
(find-file-noselect f) (find-file-noselect f)
(goto-char (point-min)) (goto-char (point-min))
(if (not (outline-on-heading-p)) (outline-next-heading)) (when (not (outline-on-heading-p)) (outline-next-heading))
(setq prev-point -1) (setq max-reached nil)
(while (> (point) prev-point) (while (not max-reached)
(let ((new-ts (nd/get-timestamps))) (let ((new-ts (nd/get-timestamps)))
(if new-ts (setq ts-list (cons new-ts ts-list)))) (if new-ts (setq ts-list (cons new-ts ts-list))))
(setq prev-point (point)) (unless (outline-next-heading) (setq max-reached t)))))
(outline-next-heading))))
;; sort the timestamp list ;; sort the timestamp list
;; TODO, need to make range-aware ;; TODO, need to make range-aware