emacs-orgmode@gnu.org archives
 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

* Re: Re: iCal Import - updated code & Bug report
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-06-20  9:49 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode

I am trying to find this bug and have made a google agenda.
How do I know which url to use to download it?  Can you guide me 
through this?

Thanks.

- Carsten
On Jun 20, 2007, at 0:52, Tim O'Callaghan wrote:

> 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 ---
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: Re: iCal Import - updated code & Bug report
  2007-06-20  9:49 ` Carsten Dominik
@ 2007-06-20 10:48   ` Tim O'Callaghan
  2007-06-21  9:30     ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Tim O'Callaghan @ 2007-06-20 10:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Its not a google calendar based bug. It happens when the referenced
org file has no headings. If you add a file with a %% diary entry and
no '* heading' to your agenda file list, it should crop up when you
try to look into diary entry file from agenda.

On the google calendar side, you select 'calendar settings' from the
drop down menu beside the calendar, or select the calendar from the
manage calendar page. On the resulting page you should see 'public'
and 'private' ical icons. Select the private one and a url will pop up
in a window.
That is the url value to use in the 'google-ical-org-list'.

You can also use public iCal links. I have added below some public
calendars that i use, that you might also find useful, and that also
generate this bug.

(setq google-ical-org-list
      '(
        ("http://upcoming.yahoo.com/calendar/v2/place/upI5ACueA5szd_8-"
         "~/CalendarSync/UpComing.ics"
         "~/CalendarSync/Upcoming.org")
        ("http://www.kagankalender.com/calendarics.php"
         "~/CalendarSync/GothInd.ics"
         "~/CalendarSync/GothInd.org")
        ))

Hope it helps,

Tim.

On 20/06/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> I am trying to find this bug and have made a google agenda.
> How do I know which url to use to download it?  Can you guide me
> through this?
>
> Thanks.
>
> - Carsten
> On Jun 20, 2007, at 0:52, Tim O'Callaghan wrote:
>
> > 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 ---
> >
> >
> > _______________________________________________
> > Emacs-orgmode mailing list
> > Emacs-orgmode@gnu.org
> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> >
> >
>
> --
> Carsten Dominik
> Sterrenkundig Instituut "Anton Pannekoek"
> Universiteit van Amsterdam
> Kruislaan 403
> NL-1098SJ Amsterdam
> phone: +31 20 525 7477
>
>

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

* Re: Re: iCal Import - updated code & Bug report
  2007-06-20 10:48   ` Tim O'Callaghan
@ 2007-06-21  9:30     ` Carsten Dominik
  2007-06-21 10:00       ` Tim O'Callaghan
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-06-21  9:30 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode

I am unable to reproduce this bug.  Anyone?

- Carsten

On Jun 20, 2007, at 12:48, Tim O'Callaghan wrote:

> Its not a google calendar based bug. It happens when the referenced
> org file has no headings. If you add a file with a %% diary entry and
> no '* heading' to your agenda file list, it should crop up when you
> try to look into diary entry file from agenda.
>
> On the google calendar side, you select 'calendar settings' from the
> drop down menu beside the calendar, or select the calendar from the
> manage calendar page. On the resulting page you should see 'public'
> and 'private' ical icons. Select the private one and a url will pop up
> in a window.
> That is the url value to use in the 'google-ical-org-list'.
>
> You can also use public iCal links. I have added below some public
> calendars that i use, that you might also find useful, and that also
> generate this bug.
>
> (setq google-ical-org-list
>      '(
>        ("http://upcoming.yahoo.com/calendar/v2/place/upI5ACueA5szd_8-"
>         "~/CalendarSync/UpComing.ics"
>         "~/CalendarSync/Upcoming.org")
>        ("http://www.kagankalender.com/calendarics.php"
>         "~/CalendarSync/GothInd.ics"
>         "~/CalendarSync/GothInd.org")
>        ))
>
> Hope it helps,
>
> Tim.
>
> On 20/06/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>> I am trying to find this bug and have made a google agenda.
>> How do I know which url to use to download it?  Can you guide me
>> through this?
>>
>> Thanks.
>>
>> - Carsten
>> On Jun 20, 2007, at 0:52, Tim O'Callaghan wrote:
>>
>> > 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 ---
>> >
>> >
>> > _______________________________________________
>> > Emacs-orgmode mailing list
>> > Emacs-orgmode@gnu.org
>> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>> >
>> >
>>
>> --
>> Carsten Dominik
>> Sterrenkundig Instituut "Anton Pannekoek"
>> Universiteit van Amsterdam
>> Kruislaan 403
>> NL-1098SJ Amsterdam
>> phone: +31 20 525 7477
>>
>>
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: Re: iCal Import - updated code & Bug report
  2007-06-21  9:30     ` Carsten Dominik
@ 2007-06-21 10:00       ` Tim O'Callaghan
  0 siblings, 0 replies; 5+ messages in thread
From: Tim O'Callaghan @ 2007-06-21 10:00 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

My apologies, i should have included this before:

Debugger entered--Lisp error: (error "before first heading")
  signal(error ("before first heading"))
  cerror("before first heading")
  apply(cerror "before first heading" nil)
  error("before first heading")
  (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)") nil
t) (error "before first heading"))
  (while (not found) (or (re-search-backward ... nil t) (error "before
first heading")) (setq found (and ... ...)))
  (save-excursion (while (not found) (or ... ...) (setq found ...)))
  (let (found) (save-excursion (while ... ... ...)) (goto-char found) found)
  (or (outline-on-heading-p invisible-ok) (let (found) (save-excursion
...) (goto-char found) found))
  org-back-to-heading(t)
  (let ((fun ...) (pos ...) (re ...) level l) (org-back-to-heading t)
(setq level (funcall outline-level)) (catch (quote exit) (or previous
...) (while ... ... ... ...) (goto-char pos) nil))
  org-goto-sibling()
  (while (org-goto-sibling) (org-flag-heading nil))
  (save-excursion (while (org-goto-sibling) (org-flag-heading nil)))
  org-show-siblings()
  (if siblings-p (org-show-siblings))
  (when siblings-p (org-show-siblings))
  (catch (quote exit) (if heading-p (org-flag-heading nil) (and ...
...)) (when following-p (save-excursion ...)) (when siblings-p
(org-show-siblings)) (when hierarchy-p (save-excursion ...)))
  (let ((heading-p ...) (hierarchy-p ...) (following-p ...)
(siblings-p ...)) (catch (quote exit) (if heading-p ... ...) (when
following-p ...) (when siblings-p ...) (when hierarchy-p ...)))
  org-show-context(agenda)
  (progn (org-show-context (quote agenda)) (save-excursion (and ... ...)))
  (if (org-mode-p) (progn (org-show-context ...) (save-excursion ...)))
  (when (org-mode-p) (org-show-context (quote agenda)) (save-excursion
(and ... ...)))
  (let* ((marker ...) (buffer ...) (pos ...))
(switch-to-buffer-other-window buffer) (widen) (goto-char pos) (when
(org-mode-p) (org-show-context ...) (save-excursion ...)) (and
highlight (org-highlight ... ...)))
  org-agenda-goto(t)
  (let ((win ...)) (org-agenda-goto t) (select-window win))
  org-agenda-show()
  (if (and org-agenda-follow-mode (get-text-property ... ...))
(org-agenda-show))
  org-agenda-post-command-hook()

It occurs in noutline.el, the error is generated when it cannot find a
heading. I'm running the windows native - XEmacs Lucid 21.4 (patch 19)
"Constant Variable"

cheers,

Tim.


On 21/06/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> I am unable to reproduce this bug.  Anyone?
>
> - Carsten
>
>

^ 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 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).