unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Yak-shaving from org-caldav to url-dav.el
@ 2014-06-30 11:27 Alexis
  2014-06-30 17:15 ` David Engster
  0 siblings, 1 reply; 2+ messages in thread
From: Alexis @ 2014-06-30 11:27 UTC (permalink / raw)
  To: emacs-devel


Hi all,

Trying to get org-caldav working has raised a tangled web of issues,
which i'm not sure i can tease apart enough to be able to submit
suitable bug reports.

Context: Emacs 24.3.92 on 32-bit Debian Wheezy. The CalDAV server with
which i'm trying to interact is DAViCal 1.1.1; i can confirm that the
server works fine with IceDove/Thunderbird.


(1) Calling the `org-caldav-sync` command results in failure:

> Got error status from PROPFIND: 
> (("[calendar URL]" DAV:status 207 . " "))

The `org-caldav` page:

  https://github.com/dengste/org-caldav

states:

> This package depends on the url-dav package, which unfortunately is
> broken in Emacs <=24.2. If you don't want to upgrade Emacs, you can
> get a working version here:
>
> http://randomsample.de/url-dav.el

One critical bit of code included in this version, but not in the
24.3.92 version of `url-dav.el`, are lines 420-423:

    ;; This package was initially written for a different kind of
    ;; QNAMES expansion, hence we have now to rewrite those so that
    ;; for example ("DAV:" . "foo") becomes the symbol 'DAV:foo.
    (url-dav-changexml (car tree))

Without this, HTTP 207 ("Multi-Status") responses from the CalDAV
server aren't processed correctly, resulting in the "error status from
PROPFIND" failure.


(2) So, let's "(load)" the randomsample version of `url-dav.el`. Doing
so results in a new failure:

> "The URL [calendar URL] does not seem to accept DAV requests"

It turns out the problem is in this version's `url-dav-supported-p`;
specifically, the line:

    (fboundp 'xml-expand-namespace)

which, from what i can tell, was removed from `url-dav.el` in 2012.


(3) So, let's comment out that line. Doing so results in a new
failure:

> "No child nodes in DAV:prop"

when in `url-dav-process-DAV:prop`. This is rather odd, because if we
do:

    (let ((url-request-extra-headers '(("Depth: 1")))
          (url-request-method "PROPFIND"))
      (display-buffer (url-retrieve-synchronously (org-caldav-events-url))))

the buffer shows that there are two `<response>` elements in the
`<multistatus>` tag, the second of which contains a fully-fleshed out
`<prop>` element, which itself contains the details of the single
event on that calendar.


(4) Finally, not a functionality issue, but a maintenance issue:
what's with the comment on line 409 of the 24.3.92 version of
`url-dav.el`?

    ;; We should now be

It looks like it's been truncated, but that line apparently hasn't
been modified since initial checkin in 2004.


So i'm now stuck. Am i doing something wrong? Any suggestions for how
i might be able to proceed?


Alexis.



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

* Re: Yak-shaving from org-caldav to url-dav.el
  2014-06-30 11:27 Yak-shaving from org-caldav to url-dav.el Alexis
@ 2014-06-30 17:15 ` David Engster
  0 siblings, 0 replies; 2+ messages in thread
From: David Engster @ 2014-06-30 17:15 UTC (permalink / raw)
  To: Alexis; +Cc: emacs-devel

Alexis writes:
> (1) Calling the `org-caldav-sync` command results in failure:
>
>> Got error status from PROPFIND: 
>> (("[calendar URL]" DAV:status 207 . " "))

I've added 207 as a valid PROPFIND result, so this should be fixed, but
will probably fail later on (I never tested it with DAViCal).

> One critical bit of code included in this version, but not in the
> 24.3.92 version of `url-dav.el`, are lines 420-423:
>
>     ;; This package was initially written for a different kind of
>     ;; QNAMES expansion, hence we have now to rewrite those so that
>     ;; for example ("DAV:" . "foo") becomes the symbol 'DAV:foo.
>     (url-dav-changexml (car tree))

That part was deemed to hackish and fixed in another way.

> Without this, HTTP 207 ("Multi-Status") responses from the CalDAV
> server aren't processed correctly, resulting in the "error status from
> PROPFIND" failure.

That's weird, since nothing but HTTP 200 should have been accepted.

> (2) So, let's "(load)" the randomsample version of `url-dav.el`. Doing
> so results in a new failure:

You cannot use that hacked url-dav together with newer Emacsen.

Please try the latest org-caldav version and let me know how it works
(on GitHub please, since this doesn't affect Emacs development).

-David



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

end of thread, other threads:[~2014-06-30 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30 11:27 Yak-shaving from org-caldav to url-dav.el Alexis
2014-06-30 17:15 ` David Engster

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).