[Top][All Lists]

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

[Orgmode] Re: iCal Import - updated code & Bug report

From: Tim O'Callaghan
Subject: [Orgmode] Re: iCal Import - updated code & Bug report
Date: Wed, 20 Jun 2007 00:52:28 +0200

Another Xemacs bug i think, If the org file does not contain a line
with a headline, such as those generated by the code. It causes the
"(1) (error/warning) Error in `post-command-hook' (setting hook to
nil): (wrong-type-argument integer-or-marker-p nil)"

The previous code assumes the ical export worked, below fixes that.

---- code ----
(defun toc:goggle-to-org ()
 "get a google calendar and convert it into org dates"
   (let* ((glist google-ical-org-list))
     ;; iterate through list
     (while (setq entry (pop glist))
       (setq google-ical-url (car entry) local-ical-file (nth 1
entry) local-date-file (nth 2 entry))
       ;; Delete the diary local files
       (if (file-exists-p local-ical-file) (delete-file local-ical-file))
       (if (file-exists-p local-date-file) (delete-file local-date-file))
       ;; Get ical file
       (w3-download-url google-ical-url (expand-file-name local-ical-file))
       ;; convert to diary without leading &
       (icalendar-import-file local-ical-file local-date-file t)
       ;; iCalendar leaves the buffers open
       (if (find-buffer-visiting local-date-file) (kill-buffer
(find-buffer-visiting local-date-file)))
       (if (find-buffer-visiting local-ical-file) (kill-buffer
(find-buffer-visiting local-ical-file)))
--- code ---

reply via email to

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