On Sun, 2009-11-08 at 11:33 +0100, Michael Albinus wrote: > Gaute Amundsen <[email protected]> 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 _______________________________________________ Tramp-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/tramp-devel
