info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying text/calendar (VCALENDAR) parts?


From: Leonidas Tsampros
Subject: Re: Displaying text/calendar (VCALENDAR) parts?
Date: Fri, 07 Oct 2011 09:46:53 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> asjo@koldfront.dk (Adam Sjøgren) writes:
>
>> Does anyone have a recipe for displaying text/calendar (VCALENDAR) parts
>> nicely?
>
> Is that a standard data format?  If so, you'd think someone would have
> written something to display them in Emacs?

Hi Lars,

I took up the task and made a sample configuration snippet on how I
imagine rendering text/calendar mime parts. It's very crude but you get
the idea. There are some things missing however I'm planning to improve
it real soon adding some font locking, extra information from vcalendar
invitation.

The below snippet has been tested with both an Outlook generated meeting
request and a Google Calendar one.

My real target is to be able to response to these messages too in the
appropriate way (Accept/Reject etc).

Anyway here you go:

(add-to-list 'mm-inlined-types "text/calendar")
(add-to-list 'mm-automatic-display "text/calendar")
(add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar 
identity))

(require 'icalendar)
(require 'boxquote)

(add-to-list 'mm-inlined-types "text/calendar")
(add-to-list 'mm-automatic-display "text/calendar")
(add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar 
identity))

(require 'icalendar)
(require 'boxquote)

(defun mm-inline-text-calendar (handle)
  (with-temp-buffer
      (mm-insert-part handle)
      (save-window-excursion
        (setq text (lala (icalendar--read-element nil nil)))))
  (boxquote-text text)
  (mm-insert-inline handle "\n"))

(defun lala (temp)
  (setq elems '(ORGANIZER ATTENDEE SUMMARY)
        e (car (icalendar--all-events temp)))
  (let (value)
    (dolist (el elems)
      (setq value (format (concat "%s:%s\n" value)
                          el
                          (icalendar--get-event-property e el))))
    value))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]