Function: icalendar-print-text

icalendar-print-text is a byte-compiled function defined in icalendar-parser.el.gz.

Signature

(icalendar-print-text VAL)

Documentation

Serialize an iCalendar text value.

VAL may be a string or text region (see icalendar-make-text-region). The text will be escaped before printing. If VAL is a region, the text it contains will not be modified; it is copied before escaping.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:print-text (val)
  "Serialize an iCalendar text value.
VAL may be a string or text region (see `icalendar-make-text-region').
The text will be escaped before printing.  If VAL is a region, the text
it contains will not be modified; it is copied before escaping."
  (if (stringp val)
      (ical:escape-text-string val)
    ;; val is a region, so copy and escape its contents:
    (let* ((beg (ical:text-region-begin val))
           (buf (marker-buffer beg))
           (end (ical:text-region-end val)))
      (with-temp-buffer
        (insert-buffer-substring buf (marker-position beg) (marker-position end))
        (ical:escape-text-in-region (point-min) (point-max))
        (buffer-string)))))