Function: org-element-comment-block-parser
org-element-comment-block-parser is a byte-compiled function defined
in org-element.el.gz.
Signature
(org-element-comment-block-parser LIMIT AFFILIATED)
Documentation
Parse an export block.
LIMIT bounds the search. AFFILIATED is a list of which CAR is the buffer position at the beginning of the first affiliated keyword and CDR is a plist of affiliated keywords along with their value.
Return a new syntax node of comment-block type containing :begin,
:end, :value, :post-blank and :post-affiliated properties.
Assume point is at comment block beginning.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
;;;; Comment Block
(defun org-element-comment-block-parser (limit affiliated)
"Parse an export block.
LIMIT bounds the search. AFFILIATED is a list of which CAR is
the buffer position at the beginning of the first affiliated
keyword and CDR is a plist of affiliated keywords along with
their value.
Return a new syntax node of `comment-block' type containing `:begin',
`:end', `:value', `:post-blank' and `:post-affiliated' properties.
Assume point is at comment block beginning."
(let ((case-fold-search t))
(if (not (save-excursion
(re-search-forward "^[ \t]*#\\+END_COMMENT[ \t]*$" limit t)))
;; Incomplete block: parse it as a paragraph.
(org-element-paragraph-parser limit affiliated)
(let ((contents-end (match-beginning 0)))
(save-excursion
(let* ((begin (car affiliated))
(post-affiliated (point))
(contents-begin (progn (forward-line) (point)))
(pos-before-blank (progn (goto-char contents-end)
(forward-line)
(point)))
(end (progn (skip-chars-forward " \r\t\n" limit)
(if (eobp) (point) (line-beginning-position))))
(value
(org-element-deferred-create
t #'org-element--substring
(- contents-begin begin)
(- contents-end begin))))
(org-element-create
'comment-block
(nconc
(list :begin begin
:end end
:value value
:post-blank (count-lines pos-before-blank end)
:post-affiliated post-affiliated)
(cdr affiliated)))))))))