Function: org-element-property-drawer-parser

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

Signature

(org-element-property-drawer-parser LIMIT)

Documentation

Parse a property drawer.

LIMIT bounds the search.

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

Assume point is at the beginning of the property drawer.

Source Code

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

(defun org-element-property-drawer-parser (limit)
  "Parse a property drawer.

LIMIT bounds the search.

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

Assume point is at the beginning of the property drawer."
  (save-excursion
    (let ((case-fold-search t)
	  (begin (point))
	  (contents-begin (line-beginning-position 2)))
      (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)
      (let ((contents-end (and (> (match-beginning 0) contents-begin)
			       (match-beginning 0)))
	    (before-blank (progn (forward-line) (point)))
	    (end (progn (skip-chars-forward " \r\t\n" limit)
			(if (eobp) (point) (line-beginning-position)))))
	(org-element-create
         'property-drawer
	 (list :begin begin
	       :end end
	       :contents-begin (and contents-end contents-begin)
	       :contents-end contents-end
	       :post-blank (count-lines before-blank end)
	       :post-affiliated begin))))))