From d011ce0422cecbca84fe84082856b1bfdf07d97c Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 24 Jan 2018 20:55:10 +0100 Subject: [PATCH] [Timeline] Barf if no clocklines can be found in given range --- site-lisp/timeline-tools.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/site-lisp/timeline-tools.el b/site-lisp/timeline-tools.el index 579bce3..4ba635b 100644 --- a/site-lisp/timeline-tools.el +++ b/site-lisp/timeline-tools.el @@ -260,10 +260,14 @@ When called interactively, START and END are queried with `org-read-date’." (interactive (list (org-read-date nil nil nil "Start time: ") (org-read-date nil nil nil "End time: "))) - (let ((timeline (-reduce-from (lambda (tl f) - (funcall f tl)) - (timeline-tools-timeline tstart tend files) - timeline-tools-filter-functions))) + (let* ((timeline (timeline-tools-timeline tstart tend files))) + (when (null timeline) + (user-error "No clocklines found in given range")) + (setq timeline + (-reduce-from (lambda (tl f) + (funcall f tl)) + timeline + timeline-tools-filter-functions)) (let ((target-buffer (get-buffer-create " *Org Timeline*"))) (with-current-buffer target-buffer (erase-buffer)