From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82550 Path: news.gmane.org!not-for-mail From: david.goldberg6@verizon.net (Dave Goldberg) Newsgroups: gmane.emacs.gnus.general Subject: Re: icalendar.el and gnus. Date: Thu, 29 Nov 2012 22:21:39 -0500 Message-ID: <8438zrbwsc.fsf@davestoy.homelinux.org> References: <87obih4a6q.fsf@mat.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354245763 6324 80.91.229.3 (30 Nov 2012 03:22:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2012 03:22:43 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M30815@lists.math.uh.edu Fri Nov 30 04:22:54 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TeHBl-0004Qp-SY for ding-account@gmane.org; Fri, 30 Nov 2012 04:22:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1TeHBN-0006Uw-Jy; Thu, 29 Nov 2012 21:22:29 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1TeHBL-0006Uc-II for ding@lists.math.uh.edu; Thu, 29 Nov 2012 21:22:27 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TeHBH-0000ox-LH for ding@lists.math.uh.edu; Thu, 29 Nov 2012 21:22:25 -0600 Original-Received: from vms173005pub.verizon.net ([206.46.173.5]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1TeHBG-00008e-1d for ding@gnus.org; Fri, 30 Nov 2012 04:22:22 +0100 Original-Received: from davestoy.homelinux.org.verizon.net ([unknown] [173.48.214.182]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MEA00ALG6O3UZ90@vms173005.mailsrvcs.net> for ding@gnus.org; Thu, 29 Nov 2012 21:21:59 -0600 (CST) X-Face: W!bie|rYVd43O:2CkHTb*~s5}Yzx30X<@6Tq_bnP56Hp!xX4sVl4tgYRirjRcke\wfY!JJ9 i?]VIUJicJzq2\!3%7$5R%wi!R[.]Va97q In-reply-to: <87obih4a6q.fsf@mat.ucm.es> (Uwe Brauer's message of "Wed, 28 Nov 2012 23:47:09 +0100") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (gnu/linux) X-Spam-Score: -0.4 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82550 > Hello > I have 2 problems with icalendar.el (I contacted the author, > but since he did not reply yet, I thought maybe someone else > has some experience). > The first problem concerns how to automatically call the > icalendar import function (which imports an icalendar event > to the diary) when opening a message. > I used > (setq gnus-article-mime-part-function 'icalendar-import-buffer) > but then I obtain an error which I attach. I use the following. The only thing I remember about it was the need to deal with uuencoded calendar entries; I don't recall any other error. Don't use it verbatim. I have hardcoded destination file names in it. (defun dsg-icalendar-handle-part (handle) (when (equal (car (mm-handle-type handle)) "text/calendar") (with-temp-buffer (insert (mm-get-part handle)) (if (equal (mm-handle-encoding handle) 'uuencode) (uudecode-decode-region-internal (point-min) (point-max))) (goto-char (point-min)) (let* ((e (car (icalendar--all-events (icalendar--read-element nil nil)))) (subject (icalendar--convert-string-for-import (or (icalendar--get-event-property e 'SUMMARY) "No Subject"))) (dtstart (icalendar--get-event-property e 'DTSTART)) (dtstart-dec (icalendar--decode-isodatetime dtstart)) (start-d (icalendar--datetime-to-diary-date dtstart-dec)) (start-t (icalendar--datetime-to-colontime dtstart-dec)) (repq (icalendar--get-event-property e 'RRULE))) (if (y-or-n-p (format "Add %s for \"%s\" on %s at %s to diary? " (if repq "repeating event" "appointment") subject start-d start-t)) (icalendar-import-buffer (expand-file-name (if repq "~/repeating-diary" "~/ical-diary")) t nil)))))) (setq gnus-article-mime-part-function 'dsg-icalendar-handle-part) -- Dave Goldberg david.goldberg6@verizon.net