Function: diary-icalendar-parse-entry-linewise

diary-icalendar-parse-entry-linewise is a byte-compiled function defined in diary-icalendar.el.gz.

Signature

(diary-icalendar-parse-entry-linewise BEGIN END VTIMEZONE TYPE DATE-NODES)

Documentation

Convert the entry between BEGIN and END linewise to iCalendar components.

"Linewise" means each line of a diary entry will be exported as a
distinct event; see diary-icalendar-export-linewise. Returns a list of component nodes representing the events.

VTIMEZONE must be the icalendar-vtimezone in which times in the entry appear (or nil). TYPE and DATE-NODES must contain the iCalendar component type and date information parsed from the beginning of the entry which apply to all of the events. These arguments are passed on in recursive calls to diary-icalendar-parse-entry.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
;;; Parsing complete diary entries:

(defun di:parse-entry-linewise (begin end vtimezone type date-nodes)
  "Convert the entry between BEGIN and END linewise to iCalendar components.

\"Linewise\" means each line of a diary entry will be exported as a
distinct event; see `diary-icalendar-export-linewise'.
Returns a list of component nodes representing the events.

VTIMEZONE must be the `icalendar-vtimezone' in which times in the entry
appear (or nil).  TYPE and DATE-NODES must contain the iCalendar component
type and date information parsed from the beginning of the entry which
apply to all of the events.  These arguments are passed on in recursive
calls to `diary-icalendar-parse-entry'."
  (save-restriction
    (narrow-to-region begin end)
    (goto-char (point-min))
    (let ((subentry-regexp
           ;; match to the end of lines which have indentation equal to
           ;; or greater than the current one:
           (rx line-start
               (group-n 1 (+ space))
               (* not-newline)
               (* "\n" (backref 1) (+ space) (* not-newline))))
          components)

      (while (re-search-forward subentry-regexp end t)
        (let ((next-pos (1+ (match-end 0))))
          (setq components
                (append
                 (di:parse-entry (match-beginning 0) (match-end 0)
                                  vtimezone type date-nodes)
                 components))
          (goto-char next-pos)))
      components)))