Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* icalendar import while opening an article
@ 2010-02-08 13:55 Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2010-02-08 13:55 UTC (permalink / raw)
  To: info-gnus-english

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?


Uwe Brauer 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: icalendar import while opening an article
  2010-02-08 21:19 ` Jens Thiele
@ 2010-02-09 10:58   ` Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2010-02-09 10:58 UTC (permalink / raw)
  To: info-gnus-english


   > ,----
   > | `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)
   > | 
   > `----

Precisely! That is what I was looking for thanks very much!

Uwe 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: icalendar import while opening an article
       [not found] <mailman.864.1265637337.14305.info-gnus-english@gnu.org>
@ 2010-02-08 21:19 ` Jens Thiele
  2010-02-09 10:58   ` Uwe Brauer
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Thiele @ 2010-02-08 21:19 UTC (permalink / raw)
  To: info-gnus-english

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-09 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-08 13:55 icalendar import while opening an article Uwe Brauer
     [not found] <mailman.864.1265637337.14305.info-gnus-english@gnu.org>
2010-02-08 21:19 ` Jens Thiele
2010-02-09 10:58   ` Uwe Brauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).