Variable: icalendar-pre-unfolding-hook

icalendar-pre-unfolding-hook is a customizable variable defined in icalendar-parser.el.gz.

Value

nil

Documentation

Hook run before unfolding iCalendar data.

The functions in this hook will be run before the iCalendar data is
"unfolded", i.e., before whitespace introduced for breaking long lines
is removed (see icalendar-unfold-region and icalendar-unfold-undecoded-region). If you routinely receive iCalendar data that is not correctly folded, you can add functions to this hook which clean up that data before unfolding is attempted.

Each function should accept zero arguments and should perform its operation on the entire current buffer.

This variable was added, or its default value changed, in Emacs 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
;;; Functions for folding and unfolding
;;
;; According to RFC5545, iCalendar content lines longer than 75 octets
;; should be *folded* by inserting extra line breaks and leading
;; whitespace to continue the line.  Such lines must be *unfolded*
;; before they can be parsed.  Unfolding can only reliably happen
;; before Emacs decodes a region of text, because decoding potentially
;; replaces the CR-LF line endings which terminate content lines.
;; Programs that can control when decoding happens should use the
;; stricter `ical:unfold-undecoded-region' to unfold text; programs
;; that must work with decoded data should use the looser
;; `ical:unfold-region'. `ical:fold-region' will fold content lines
;; using line breaks appropriate to the buffer's coding system.
;;
;; All the parsing-related code below assumes that lines have
;; already been unfolded if necessary.
(defcustom ical:pre-unfolding-hook nil
  "Hook run before unfolding iCalendar data.

The functions in this hook will be run before the iCalendar data is
\"unfolded\", i.e., before whitespace introduced for breaking long lines
is removed (see `icalendar-unfold-region' and
`icalendar-unfold-undecoded-region').  If you routinely receive
iCalendar data that is not correctly folded, you can add functions to
this hook which clean up that data before unfolding is attempted.

Each function should accept zero arguments and should perform its
operation on the entire current buffer."
  :version "31.1"
  :type '(hook)
  :options '(ical:fix-line-endings))