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.
This commit is contained in:
parent
24be24077c
commit
f00c22a49a
1 changed files with 2 additions and 3 deletions
|
@ -174,10 +174,9 @@ If set to nil, will never create stories with labels")
|
||||||
|
|
||||||
(defun org-clubhouse-collect-headlines (beg end)
|
(defun org-clubhouse-collect-headlines (beg end)
|
||||||
"Collects the headline at point or the headlines in a region. Returns a list."
|
"Collects the headline at point or the headlines in a region. Returns a list."
|
||||||
(setq test-headlines
|
|
||||||
(if (and beg end)
|
(if (and beg end)
|
||||||
(org-clubhouse-get-headlines-in-region 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)
|
(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)))
|
(let ((before (point)))
|
||||||
(org-forward-heading-same-level 1)
|
(org-forward-heading-same-level 1)
|
||||||
(setq before-end (and (not (eq before (point))) (< (point) end)))))
|
(setq before-end (and (not (eq before (point))) (< (point) end)))))
|
||||||
headlines)))
|
(reverse headlines))))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; Org-element interaction
|
;;; Org-element interaction
|
||||||
|
|
Loading…
Reference in a new issue