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 list whose car is property-drawer and cdr is a plist containing :begin, :end, :contents-begin, :contents-end,
:post-blank and :post-affiliated keywords.

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 list whose car is `property-drawer' and cdr is a plist
containing `:begin', `:end', `:contents-begin', `:contents-end',
`:post-blank' and `:post-affiliated' keywords.

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)))))
	(list '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))))))