[Timeline] Don’t do filtering anymore

Instead draw lines when the category changes.
This commit is contained in:
Daniel - 2018-07-31 14:09:56 +02:00
parent ddded41c7a
commit 023a14f8e7
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 16 additions and 16 deletions

View File

@ -26,10 +26,7 @@
:group 'timeline-tools :group 'timeline-tools
:type 'integer) :type 'integer)
(defcustom timeline-tools-filter-functions (defcustom timeline-tools-filter-functions nil
'(timeline-tools-cluster-same-category
timeline-tools-skip-short-entries
timeline-tools-cluster-same-category)
"List of functions to apply when formatting timelines. "List of functions to apply when formatting timelines.
Filter are applied in the order they are given in this list." Filter are applied in the order they are given in this list."
:group 'timeline-tools :group 'timeline-tools
@ -406,18 +403,21 @@ ending at 23:61. When not given, FILES defaults to
timeline-tools--current-time-end))) timeline-tools--current-time-end)))
(insert "|--|\n") (insert "|--|\n")
(insert "| Category | Start | End | Duration | Task |\n") (insert "| Category | Start | End | Duration | Task |\n")
(insert "|--|\n") (let ((last-category nil))
(dolist (cluster timeline) (dolist (cluster timeline)
(insert (format "| %s | %s | %s | %s min | " (when (not (equal last-category (timeline-tools-entry-category cluster)))
(timeline-tools-entry-category cluster) (insert "|--|\n")
(timeline-tools-format-entry-time cluster 'start) (setq last-category (timeline-tools-entry-category cluster)))
(timeline-tools-format-entry-time cluster 'end) (insert (format "| %s | %s | %s | %s min | "
(timeline-tools-entry-duration cluster))) (timeline-tools-entry-category cluster)
;; insert headline line by line (timeline-tools-format-entry-time cluster 'start)
(dolist (headline (-interpose "|\n |||||" (timeline-tools-format-entry-time cluster 'end)
(timeline-tools-entry-headlines cluster))) (timeline-tools-entry-duration cluster)))
(insert headline)) ;; insert headline line by line
(insert "\n")) (dolist (headline (-interpose "|\n |||||"
(timeline-tools-entry-headlines cluster)))
(insert headline))
(insert "\n")))
(insert "|--|\n") (insert "|--|\n")
(org-table-align) (org-table-align)
(goto-char (point-min))))) (goto-char (point-min)))))