From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: icalendar-import-file into org Date: Tue, 04 Jun 2013 09:07:18 -0400 Message-ID: <87d2s2owhl.fsf@pierrot.dokosmarshall.org> References: <3042056.WMNdFTD4ds@linux-ik7b.site> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujqxe-0001et-9J for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 09:07:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjqxZ-0006oF-Lh for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 09:07:38 -0400 Received: from plane.gmane.org ([80.91.229.3]:42726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjqxZ-0006o7-Ea for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 09:07:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjqxX-0002bj-Hb for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 15:07:31 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 15:07:31 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 15:07:31 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org AW writes: > I'd like to have an external calendar file displayed in org and was very glad > to find a hint in the manual. The name of the external calendar file is > "office.ics". > > So I wrote into my .emacs-file: > > (icalendar-import-file "office.ics" "Diary") > (setq org-agenda-include-diary t) > > As you can imagine, that caused an import of "office.ics" _every_ time I started > Emacs. So I ended with a huge calendar file full of (no, not stars)[1] > repetitions of "office.ics". > You can import the ics file into some temporary diary and delete the temporary diary upon exit from emacs: --8<---------------cut here---------------start------------->8--- (setq tmp-diary (make-temp-file "diary")) (icalendar-import-file "/path/to/office.ics" tmp-diary) ;; make it the default... (setq diary-file tmp-diary) ;; so that org-agenda can find it (setq org-agenda-include-diary t) ;; delete the tmp diary on exit (add-to-list 'kill-emacs-hook (function (lambda () (delete-file tmp-diary)))) --8<---------------cut here---------------end--------------->8--- That assumes that you don't have any other diary files that you are interested in including. If you do, the basic idea will still work but will require more fiddling. Untested. -- Nick