From aec7aa6267e382d17b9215e2b343a59b1ee09c0f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 20 Mar 2023 22:57:16 -0700 Subject: [PATCH] =?UTF-8?q?[oni-org]=20Fix=20=E2=80=98oni-org-pomodoro-tim?= =?UTF-8?q?es=E2=80=99=20for=20when=20no=20logbook=20exists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oni-org/oni-org.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 24df0d0..5cd5cfc 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -1021,15 +1021,15 @@ placed above TARGET. Otherwise it will be placed below it." (save-excursion (goto-char entry-beginning) (save-match-data - (re-search-forward org-logbook-drawer-re entry-end) - (let ((logbook-beginning (match-beginning 0)) - (logbook-end (match-end 0))) - (goto-char logbook-beginning) - (while (re-search-forward - (rx "Finished a pomodoro on " - (group "[" (one-or-more (not "]")) "]")) - logbook-end t) - (push (org-parse-time-string (match-string 1)) results))))) + (when (re-search-forward org-logbook-drawer-re entry-end nil) + (let ((logbook-beginning (match-beginning 0)) + (logbook-end (match-end 0))) + (goto-char logbook-beginning) + (while (re-search-forward + (rx "Finished a pomodoro on " + (group "[" (one-or-more (not "]")) "]")) + logbook-end t) + (push (org-parse-time-string (match-string 1)) results)))))) results)) (defun oni-org-pomodoro-times-for-date (date)