From 9d83cb22a11ec8008c7005c65b8425b71f5206c8 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 20 May 2019 10:49:24 -0400 Subject: 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 --- org-clubhouse.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'org-clubhouse.el') 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))) -- cgit 1.4.1