Function: icalendar-documentation

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

Signature

(icalendar-documentation SYM BUF FRAME)

Documentation

iCalendar documentation backend for describe-symbol-backends.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:documentation (sym buf frame)
  "iCalendar documentation backend for `describe-symbol-backends'."
  (ignore buf frame) ; Silence the byte compiler
  (with-help-window (help-buffer)
    (with-current-buffer standard-output
      (let* ((type-doc (get sym 'icalendar-type-documentation))
             (link (get sym 'icalendar-link))
             (rx-def (get sym 'rx-definition))
             (rx-doc (when rx-def
                       (with-output-to-string
                         (pp rx-def))))
             (value-rx-def (get sym 'ical:value-rx))
             (value-rx-doc (when value-rx-def
                             (with-output-to-string
                               (pp value-rx-def))))
             (values-rx-def (get sym 'ical:values-rx))
             (values-rx-doc (when values-rx-def
                             (with-output-to-string
                               (pp values-rx-def))))

             (full-doc
              (concat
               (when type-doc
                 (format "`%s' is an iCalendar type:\n\n%s\n\n"
                         sym type-doc))
               (when link
                 (format "For further information see\nURL `%s'\n\n" link))
               ;; FIXME: this is probably better done in rx.el!
               ;; TODO: could also generalize this to recursively
               ;; search rx-def for any symbol that starts with "icalendar-"...
               (when rx-def
                 (format "`%s' is an iCalendar grammar category.
Its `rx' definition is:\n\n%s%s%s"
                         sym
                         rx-doc
                         (if value-rx-def
                             (format "\nIndividual values must match:\n%s"
                                      value-rx-doc)
                           "")
                         (if values-rx-def
                             (format "\nLists of values must match:\n%s"
                                      values-rx-doc)
                           "")))
               "\n")))

        (insert full-doc)
        full-doc))))