mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-02 08:22:16 +00:00
org-element: Correctly parse inlinetasks before first headline
* contrib/lisp/org-element.el (org-element-section-parser): Correctly parse inlinetasks before first headline.
This commit is contained in:
parent
f86de3d233
commit
588a7c261b
@ -752,21 +752,22 @@ and `:post-blank' keywords."
|
||||
(save-excursion
|
||||
;; Beginning of section is the beginning of the first non-blank
|
||||
;; line after previous headline.
|
||||
(let ((begin (save-excursion
|
||||
(org-with-limited-levels (outline-previous-heading))
|
||||
(if (not (org-at-heading-p)) (point)
|
||||
(forward-line) (org-skip-whitespace) (point-at-bol))))
|
||||
(end (progn (org-with-limited-levels (outline-next-heading))
|
||||
(point)))
|
||||
(pos-before-blank (progn (skip-chars-backward " \r\t\n")
|
||||
(forward-line)
|
||||
(point))))
|
||||
`(section
|
||||
(:begin ,begin
|
||||
:end ,end
|
||||
:contents-begin ,begin
|
||||
:contents-end ,pos-before-blank
|
||||
:post-blank ,(count-lines pos-before-blank end))))))
|
||||
(org-with-limited-levels
|
||||
(let ((begin
|
||||
(save-excursion
|
||||
(outline-previous-heading)
|
||||
(if (not (org-at-heading-p)) (point)
|
||||
(forward-line) (org-skip-whitespace) (point-at-bol))))
|
||||
(end (progn (outline-next-heading) (point)))
|
||||
(pos-before-blank (progn (skip-chars-backward " \r\t\n")
|
||||
(forward-line)
|
||||
(point))))
|
||||
`(section
|
||||
(:begin ,begin
|
||||
:end ,end
|
||||
:contents-begin ,begin
|
||||
:contents-end ,pos-before-blank
|
||||
:post-blank ,(count-lines pos-before-blank end)))))))
|
||||
|
||||
(defun org-element-section-interpreter (section contents)
|
||||
"Interpret SECTION element as Org syntax.
|
||||
|
Loading…
Reference in New Issue
Block a user