From f00c22a49af3798c8a4be6d1831b5142ff56a19e Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 8 May 2020 13:38:31 -0400 Subject: [PATCH] Don't create stories in reverse order org-clubhouse-get-headlines-in-region was returning elements in reverse order, causing stories to be created in reverse order when multiple were created in a region with org-clubhouse-create-story. Just reversing the list at the end should fix that. --- org-clubhouse.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/org-clubhouse.el b/org-clubhouse.el index 072899ecd..884c8d288 100644 --- a/org-clubhouse.el +++ b/org-clubhouse.el @@ -174,10 +174,9 @@ If set to nil, will never create stories with labels") (defun org-clubhouse-collect-headlines (beg end) "Collects the headline at point or the headlines in a region. Returns a list." - (setq test-headlines (if (and beg end) (org-clubhouse-get-headlines-in-region beg end) - (list (org-element-find-headline))))) + (list (org-element-find-headline)))) (defun org-clubhouse-get-headlines-in-region (beg end) @@ -208,7 +207,7 @@ If set to nil, will never create stories with labels") (let ((before (point))) (org-forward-heading-same-level 1) (setq before-end (and (not (eq before (point))) (< (point) end))))) - headlines))) + (reverse headlines)))) ;;; ;;; Org-element interaction