about summary refs log tree commit diff
path: root/org-clubhouse.el
diff options
context:
space:
mode:
Diffstat (limited to 'org-clubhouse.el')
-rw-r--r--org-clubhouse.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index 07c3220998c0..81aab9ad3fc3 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -258,6 +258,23 @@ If set to nil, will never create stories with labels")
   (org-element-extract-clubhouse-id
    (org-element-find-headline)))
 
+(defun org-clubhouse-clocked-in-story-id ()
+  "Return the clubhouse story-id of the currently clocked-in org entry, if any."
+  (save-mark-and-excursion
+    (save-current-buffer
+      (when (org-clocking-p)
+        (set-buffer (marker-buffer org-clock-marker))
+        (save-restriction
+          (when (or (< org-clock-marker (point-min))
+                    (> org-clock-marker (point-max)))
+            (widen))
+          (goto-char org-clock-marker)
+          (org-element-clubhouse-id))))))
+
+(comment
+ (org-clubhouse-clocked-in-story-id)
+ )
+
 (defun org-element-and-children-at-point ()
   (let* ((elt (org-element-find-headline))
          (contents-begin (or (plist-get elt :contents-begin)