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.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index fdfe2d16f8f0..7f0fcec5e2fe 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -224,9 +224,11 @@ If set to nil, will never create stories with labels")
 ;;         (org-element-find-headline)))))
 
 (defun org-element-find-headline ()
-  (let ((current-elt (org-element-at-point)))
-    (when (equal 'headline (car current-elt))
-      (cadr current-elt))))
+  (save-mark-and-excursion
+    (when (not (outline-on-heading-p)) (org-back-to-heading))
+    (let ((current-elt (org-element-at-point)))
+      (when (equal 'headline (car current-elt))
+        (cadr current-elt)))))
 
 (defun org-element-extract-clubhouse-id (elt &optional property)
   (when-let* ((clubhouse-id-link (plist-get elt (or property :CLUBHOUSE-ID))))