tramp-devel
[Top][All Lists]
Advanced

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

Re: Backup on DAV


From: Gaute Amundsen
Subject: Re: Backup on DAV
Date: Wed, 11 Nov 2009 09:02:12 +0100

On Sun, 2009-11-08 at 11:33 +0100, Michael Albinus wrote: 
> Gaute Amundsen <address@hidden> writes:
> 
> > Hi
> 
> Hi,
> 
> > There is some footwork involving content-types that eldav handled, but
> > tramp / gvfs apparently don't.
> > The effect is that when emacs creates a new file after renaming the old
> > one for backup, it gets created in zope as
> > "text/x-unknown-content-type".
> > ( in my test case I presume it should be "text/pythonscript" or somthing
> > to that effect, but I haven't fired up wireshark to look just yet )
> >
> > setting make-backup-files to nil solves that, but then all backups are
> > disabled..
> >
> > Is there a way to disable backups only when in tramp, or even better
> > only when using dav?
> 
> Try this:
> 
> (setq backup-enable-predicate
>       (lambda (name)
>         (and (normal-backup-enable-predicate name)
>              (not
>               (let ((method (file-remote-p name 'method)))
>                 (when (stringp method)
>                   (member method '("dav" "davs"))))))))
> 

Works nicely except that I get:
"file changed on disk; really edit the buffer? (y, n, r or C-h) "
when I start editing again after a save. Both with dav and sudo so far.


> I will check, whether it is possible the preserve the content-type of
> files in tramp-gvfs.el

Thanks.

Some digging around in the code of zopes "external editor" zopeedit and
a few extra logging lines seems to indicate that it defaults to
text/plain and that's what it sends for the "python (script)" file I'm
testing with.

Below is a sniff of the relevant part of gvfs communication with zope.
Seems like preserving the content-type _should_ do work.

Regards

Gaute 

-------------
GET /web/MMBase/devtools/wget_bilde HTTP/1.1
Host: localhost:2001
User-Agent: gvfs/1.4.1
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX=

-----------------
HTTP/1.1 200 OK
Server: Zope/(Zope 2.7.5-1.fc3, python 2.3.4, linux2) ZServer/1.1
Date: Tue, 10 Nov 2009 15:42:57 GMT
Content-Length: 476
Content-Type: text/plain

<script body>



---------------
PUT /web/MMBase/devtools/wget_bilde%20(copy) HTTP/1.1
Host: localhost:2001
User-Agent: gvfs/1.4.1
Authorization: Basic XXXXXXXXXXXXXXXXXXXXX=
Content-Length: 476

<script body>
-----------------
HTTP/1.1 201 Created
Server: Zope/(Zope 2.7.5-1.fc3, python 2.3.4, linux2) ZServer/1.1
Date: Tue, 10 Nov 2009 15:42:57 GMT
Accept-Ranges: bytes
Content-Length: 0










reply via email to

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