all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: iCal Import - updated code & Bug report
@ 2007-06-19 22:52 Tim O'Callaghan
  2007-06-20  9:49 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Tim O'Callaghan @ 2007-06-19 22:52 UTC (permalink / raw)
  To: emacs-orgmode

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
error:
"(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.

Tim.
---- code ----
(defun toc:goggle-to-org ()
  "get a google calendar and convert it into org dates"
  (interactive)
  (with-temp-buffer
    (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 ---

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

end of thread, other threads:[~2007-06-21 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 22:52 iCal Import - updated code & Bug report Tim O'Callaghan
2007-06-20  9:49 ` Carsten Dominik
2007-06-20 10:48   ` Tim O'Callaghan
2007-06-21  9:30     ` Carsten Dominik
2007-06-21 10:00       ` Tim O'Callaghan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.