From 8d9bdc39ded36341fa31fda15c2c668f7187454b Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 26 Jan 2020 21:01:13 +0100 Subject: [PATCH] Transform timeline even when extracting it from the buffer This reenables automatic gap filling in case it has been configure with `timeline-tools-filter-functions', but somehow breaks undo of killing in the timeline buffer. The problem seems to be that undoing a kill only restores the killed line, but not the original line entries of the lines right before and after the lined that had been killed. In this way, the timeline of the buffer has overlapping entries, resulting in odd behavior. The problem is not quite understood yet, but it seems to be that undo does not notice the changes to the surrounding lines (maybe because they have not been done by text editing functions). --- site-lisp/timeline-tools.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site-lisp/timeline-tools.el b/site-lisp/timeline-tools.el index cc9f065..0f773be 100644 --- a/site-lisp/timeline-tools.el +++ b/site-lisp/timeline-tools.el @@ -464,13 +464,13 @@ current values of the relevant buffer local variables." (interactive) (if (not (eq major-mode 'timeline-tools-mode)) (user-error "Not in Timeline buffer") - (let ((timeline (if force - (timeline-tools-transform-timeline + (let ((timeline (timeline-tools-transform-timeline + (if force (timeline-tools-timeline timeline-tools--current-time-start timeline-tools--current-time-end - timeline-tools--current-files)) - (timeline-tools--get-timeline-from-buffer)))) + timeline-tools--current-files) + (timeline-tools--get-timeline-from-buffer))))) (erase-buffer) (insert (format "* Timeline from [%s] to [%s]\n\n" (format-time-string timeline-tools-headline-time-format