about summary refs log tree commit diff
path: root/org-clubhouse.el
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-05-20T14·49-0400
committerGriffin Smith <root@gws.fyi>2019-05-20T14·49-0400
commit9d83cb22a11ec8008c7005c65b8425b71f5206c8 (patch)
tree08f20eff19aa2775a6070d816f17b7d592d37909 /org-clubhouse.el
parent603f614c3515c12f7d3c60bf6a2bf3f86625d921 (diff)
fix: Infinite loop for last element in file
org-element-and-children-at-point was comparing the current point <=
end, but should've been <.

Fixes #17
Diffstat (limited to 'org-clubhouse.el')
-rw-r--r--org-clubhouse.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index ce136a51f016..4f162d955bd4 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -257,13 +257,14 @@ If set to nil, will never create stories with labels")
 
 (defun org-element-and-children-at-point ()
   (let* ((elt (org-element-find-headline))
-         (contents-begin (plist-get elt :contents-begin))
+         (contents-begin (or (plist-get elt :contents-begin)
+                             (plist-get elt :begin)))
          (end   (plist-get elt :end))
          (level (plist-get elt :level))
          (children '()))
     (save-excursion
       (goto-char (+ contents-begin (length (plist-get elt :title))))
-      (while (<= (point) end)
+      (while (< (point) end)
         (let* ((next-elt (org-element-at-point))
                (elt-type (car next-elt))
                (elt      (cadr next-elt)))