[Timeline] Allow re-parsing the current timeline

Will update the category cache of all relevant files before redrawing the
current timeline.
This commit is contained in:
Daniel - 2018-06-29 21:22:09 +02:00
parent c4508fcca0
commit e587855fe3
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,7 @@ Filter are applied in the order they are given in this list."
(let ((map (make-sparse-keymap)))
(define-key map [remap self-insert-command] 'undefined)
(define-key map "r" #'timeline-tools-redraw-timeline)
(define-key map "R" #'timeline-tools-reparse-timeline)
(define-key map "f" #'timeline-tools-forward-day)
(define-key map "b" #'timeline-tools-backward-day)
(define-key map "q" #'quit-window)
@ -411,6 +412,20 @@ ending at 23:61. When not given, FILES defaults to
(org-table-align)
(goto-char (point-min)))))
(defun timeline-tools-reparse-timeline ()
"Parse timeline from files again and redraws current display
Updates category properties before constructing the new timeline."
(interactive)
(dolist (file timeline-tools--current-files)
(with-current-buffer (get-file-buffer file)
(org-refresh-category-properties)))
(setq-local timeline-tools--current-timeline
(timeline-tools-get-transformed-timeline
timeline-tools--current-time-start
timeline-tools--current-time-end
timeline-tools--current-files))
(timeline-tools-redraw-timeline))
(defun timeline-tools-forward-day ()
"Display timeline of next day."
(interactive)