From 70c3fc3aee3b5c50792665a8645e1a0cfe580cd9 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 21 Nov 2018 17:19:06 +0100 Subject: [PATCH] [Timeline] Make sure buffer is unfolded before iterating over clocklines --- site-lisp/timeline-tools.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site-lisp/timeline-tools.el b/site-lisp/timeline-tools.el index cc90814..b6a8fd6 100644 --- a/site-lisp/timeline-tools.el +++ b/site-lisp/timeline-tools.el @@ -125,6 +125,10 @@ on the start of the headline. Traversal will be done from the end of the file upwards. If the buffer is narrowed, only this region will be traversed." (when (eq major-mode 'org-mode) + ;; Make sure everything is visible, as otherwise editing may produce odd + ;; results + (org-cycle '(64)) + (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" org-clock-string "[ \t]*\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)")))