Function: org-element-fixed-width-parser

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

Signature

(org-element-fixed-width-parser LIMIT AFFILIATED)

Documentation

Parse a fixed-width section.

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 list whose CAR is fixed-width and CDR is a plist containing :begin, :end, :value, :post-blank and
:post-affiliated keywords.

Assume point is at the beginning of the fixed-width area.

Source Code

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

(defun org-element-fixed-width-parser (limit affiliated)
  "Parse a fixed-width section.

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 list whose CAR is `fixed-width' and CDR is a plist
containing `:begin', `:end', `:value', `:post-blank' and
`:post-affiliated' keywords.

Assume point is at the beginning of the fixed-width area."
  (save-excursion
    (let* ((begin (car affiliated))
	   (post-affiliated (point))
	   (end-area
	    (progn
	      (while (and (< (point) limit)
			  (looking-at "[ \t]*:\\( \\|$\\)"))
		(forward-line))
	      (if (bolp) (line-end-position 0) (point))))
	   (end (progn (skip-chars-forward " \r\t\n" limit)
		       (if (eobp) (point) (line-beginning-position)))))
      (list 'fixed-width
	    (nconc
	     (list :begin begin
		   :end end
		   :value (replace-regexp-in-string
			   "^[ \t]*: ?" ""
			   (buffer-substring-no-properties post-affiliated
							   end-area))
		   :post-blank (count-lines end-area end)
		   :post-affiliated post-affiliated)
	     (cdr affiliated))))))