From e587855fe3d70ace2dc607d1adba531fba3ab4c1 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 29 Jun 2018 21:22:09 +0200 Subject: [PATCH] [Timeline] Allow re-parsing the current timeline Will update the category cache of all relevant files before redrawing the current timeline. --- site-lisp/timeline-tools.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/site-lisp/timeline-tools.el b/site-lisp/timeline-tools.el index d2ca50c..408c430 100644 --- a/site-lisp/timeline-tools.el +++ b/site-lisp/timeline-tools.el @@ -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)