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

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

Re: icalendar import while opening an article


From: Jens Thiele
Subject: Re: icalendar import while opening an article
Date: Mon, 08 Feb 2010 22:19:40 +0100

Uwe Brauer <oub@mat.ucm.es> writes:

> Hello
>
> I started to use Ulf Jaspers icalendar, which allows to
> import icalendar events to the diary file.
>
> However in VM there is  hook, namely 
> (add-hook 'vm-select-new-message-hook 'icalendar-extract-ical-from-buffer)
>
> Which allows you to extract the icalendar just by opening
> the message, in gnus it is more complicated, 
>
> The icalendar event displayed as an attachment, therefore I
> have to toggle the display so see the content and then run
> the function icalendar-extract-ical-from-buffer.
>
> Does anybody know about a solution comparable to the one of VM?

Probably you want to use the gnus-article-mime-part-function variable:
see also "(gnus)MIME Commands":

,----
| `gnus-article-mime-part-function'
|      For each MIME part, this function will be called with the MIME
|      handle as the parameter.  The function is meant to be used to allow
|      users to gather information from the article (e. g., add Vcard
|      info to the bbdb database) or to do actions based on parts (e. g.,
|      automatically save all jpegs into some directory).
| 
|      Here's an example function the does the latter:
| 
|           (defun my-save-all-jpeg-parts (handle)
|             (when (equal (car (mm-handle-type handle)) "image/jpeg")
|               (with-temp-buffer
|                 (insert (mm-get-part handle))
|                 (write-region (point-min) (point-max)
|                               (read-file-name "Save jpeg to: ")))))
|           (setq gnus-article-mime-part-function
|                 'my-save-all-jpeg-parts)
| 
`----

Maybe that one helps:
http://www.mail-archive.com/gnu-emacs-sources@gnu.org/msg01295.html



reply via email to

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