Function: org-element-section-parser

org-element-section-parser is a byte-compiled function defined in org-element.el.gz.

Signature

(org-element-section-parser _)

Documentation

Parse a section.

Return a new syntax node of section type containing :begin,
:end, :contents-begin, contents-end, :post-blank and
:post-affiliated properties.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
;;;; Section

(defun org-element-section-parser (_)
  "Parse a section.

Return a new syntax node of `section' type containing `:begin',
`:end', `:contents-begin', `contents-end', `:post-blank' and
`:post-affiliated' properties."
  (save-excursion
    ;; Beginning of section is the beginning of the first non-blank
    ;; line after previous headline.
    (let* ((begin (point))
	   (end
            (if (re-search-forward (org-get-limited-outline-regexp t) nil 'move)
                (goto-char (match-beginning 0))
	      (point)))
	   (contents-end end)
           (robust-end end)
           (robust-begin begin))
      (org-element-create
       'section
       (list :begin begin
	     :end end
	     :contents-begin begin
	     :contents-end contents-end
             :robust-begin robust-begin
             :robust-end robust-end
             ;; Trailing blank lines in org-data, headlines, and
             ;; sections belong to the containing elements.
	     :post-blank 0
	     :post-affiliated begin)))))