Compare commits

...

3 Commits

Author SHA1 Message Date
5d28ab04a6
Fix some warnings in timeline-tools 2024-06-11 18:19:37 +02:00
051b578ba0
Do not include archives in timeline-tools by default
They are usually not needed, and can be included explicitly when
necessary.
2024-06-11 18:17:08 +02:00
2144c7e110
Fix headline display in timeline tools
Why did I do this that complicated to begin with?
2024-06-11 18:12:51 +02:00

View File

@ -115,7 +115,7 @@ end date of the timeline."
(define-derived-mode timeline-tools-mode
org-mode "Timeline"
"Major mode to display org-mode timelines."
"Major mode to display `org-mode' timelines."
(hl-line-mode)
(buffer-enable-undo))
@ -161,10 +161,7 @@ Return whatever is found first."
(defun timeline-tools-entry-headline (entry)
"Return the headline associated with ENTRY."
(let* ((marker (timeline-tools-entry-marker entry)))
(plist-get (cadr (org-with-point-at marker
(org-element-headline-parser (point-max))))
:raw-value)))
(org-entry-get (timeline-tools-entry-marker entry) "ITEM"))
;; Utilities
@ -297,11 +294,10 @@ returned by `timeline-tools-clocklines-in-range, which see.
Entries in the resulting list are sorted by START, ascending.
TSTART and TEND must be valid time specifiers for
`timeline-tools-clocklines-in-range. If not given,
FILES-OR-BUFFERS defaults to `org-agenda-files including all
archives."
FILES-OR-BUFFERS defaults to `org-agenda-files without archives."
(let (timeline-of-files turned-around-timeline)
(setq timeline-of-files
(->> (or files-or-buffers (org-agenda-files t t))
(->> (or files-or-buffers (org-agenda-files t nil))
(cl-mapcan #'(lambda (file-or-buffer)
(let ((buffer (cond
((bufferp file-or-buffer)
@ -410,7 +406,7 @@ Filtering is done by applying all functions from
(defun timeline-tools-format-timeline (tstart tend &optional files)
"Display timeline of tasks between TSTART and TEND from FILES.
When not given, FILES defaults to `org-agenda-files including
When not given, FILES defaults to `org-agenda-files without
archives. The timeline is transformed as given by the current
value of `timeline-tools-filter-functions. When called
interactively, START and END are queried with `org-read-date."
@ -434,7 +430,7 @@ interactively, START and END are queried with `org-read-date."
DATE should be a string of the form %Y-%m-%d. When called
interactively, this date will be queried with `org-read-date.
When not given, FILES defaults to `org-agenda-files including
When not given, FILES defaults to `org-agenda-files without
archives."
(interactive (list (org-read-date nil nil)))
(let ((timeline-tools-time-format "%H:%M")
@ -744,7 +740,7 @@ clock line."
(with-current-buffer buffer
;; Make sure everything is visible, as otherwise editing may produce odd
;; results
(org-show-all)
(org-fold-show-all)
(timeline-tools-map-clocklines
(lambda (timestamp-1 timestamp-2)