aboutsummaryrefslogtreecommitdiffstats
path: root/oni-org/oni-org.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-03-20 22:57:16 -0700
committerGravatar Tom Willemse2023-03-20 22:57:16 -0700
commitaec7aa6267e382d17b9215e2b343a59b1ee09c0f (patch)
treebb389e23a238109bccdd3863bf30a5cddb0fc067 /oni-org/oni-org.el
parentaf7ff9343a53550c7877ba30eb4c34a79d3ddb4c (diff)
downloademacs-config-aec7aa6267e382d17b9215e2b343a59b1ee09c0f.tar.gz
emacs-config-aec7aa6267e382d17b9215e2b343a59b1ee09c0f.zip
[oni-org] Fix ‘oni-org-pomodoro-times’ for when no logbook exists
Diffstat (limited to 'oni-org/oni-org.el')
-rw-r--r--oni-org/oni-org.el18
1 files 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)