find header if not currently at point

Creating a single story would fail if the point was not on a
header. Now the code tries to find the header for the element at
point.
This commit is contained in:
Jean-Martin Archer 2020-01-19 21:57:48 -08:00 committed by Griffin Smith
parent 489b37d17d
commit 16cda5b42b

View file

@ -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))))