Function: org-element-diary-sexp-parser

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

Signature

(org-element-diary-sexp-parser LIMIT AFFILIATED)

Documentation

Parse a diary sexp.

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 diary-sexp and CDR is a plist containing :begin, :end, :value, :post-blank and
:post-affiliated keywords.

Source Code

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

(defun org-element-diary-sexp-parser (limit affiliated)
  "Parse a diary sexp.

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 `diary-sexp' and CDR is a plist
containing `:begin', `:end', `:value', `:post-blank' and
`:post-affiliated' keywords."
  (save-excursion
    (let ((begin (car affiliated))
	  (post-affiliated (point))
	  (value (progn (looking-at "\\(%%(.*\\)[ \t]*$")
			(match-string-no-properties 1)))
	  (pos-before-blank (progn (forward-line) (point)))
	  (end (progn (skip-chars-forward " \r\t\n" limit)
		      (if (eobp) (point) (line-beginning-position)))))
      (list 'diary-sexp
	    (nconc
	     (list :value value
		   :begin begin
		   :end end
		   :post-blank (count-lines pos-before-blank end)
		   :post-affiliated post-affiliated)
	     (cdr affiliated))))))