* icalendar-import-file into org
@ 2013-06-04 11:47 AW
2013-06-04 13:07 ` Nick Dokos
0 siblings, 1 reply; 3+ messages in thread
From: AW @ 2013-06-04 11:47 UTC (permalink / raw)
To: emacs-orgmode
Hi!
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".
The trouble obviously is the import into "Diary". If I could write
(setq org-agenda-include "office.ics" t)
-- but as I'm not a programmer, I do not know how to do that.
If someone had a helping hand, I'd be glad,
Regards,
Alexander
[1] "My God—it's full of stars!" -- do you remember ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: icalendar-import-file into org
2013-06-04 11:47 icalendar-import-file into org AW
@ 2013-06-04 13:07 ` Nick Dokos
2013-06-04 20:21 ` AW
0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2013-06-04 13:07 UTC (permalink / raw)
To: emacs-orgmode
AW <alexander.willand@t-online.de> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: icalendar-import-file into org
2013-06-04 13:07 ` Nick Dokos
@ 2013-06-04 20:21 ` AW
0 siblings, 0 replies; 3+ messages in thread
From: AW @ 2013-06-04 20:21 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Nick Dokos
Am Dienstag, 4. Juni 2013, 09:07:18 schrieb Nick Nick Dokos:
> AW <alexander.willand@t-online.de> 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.
Hi Nick,
thank you for these lines. I realised that I've got a bug in one of my .emacs-
files, but I have to dig where: in Windows or Linux. However, both
installations of Emacs should format the date exactly the same way.
I will report when back on the surface,
Regards,
Alexander
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-04 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 11:47 icalendar-import-file into org AW
2013-06-04 13:07 ` Nick Dokos
2013-06-04 20:21 ` AW
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).