GNU bug report logs - #37573
27.0.50; Remote file opened from GNOME-Nautilus

Previous Next

Package: emacs;

Reported by: Tim Zander <tim.zander <at> kit.edu>

Date: Tue, 1 Oct 2019 15:28:01 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Fixed in version 27.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37573 <at> debbugs.gnu.org, tim.zander <at> kit.edu
Subject: bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
Date: Tue, 08 Oct 2019 14:57:54 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I've tested the scenario (editing a remote file from Nautilus via Emacs)
>> with GVFS volumes of different types. ftp and afp-volume work w/o
>> problems. ssh/sftp behaves as reported (problem with file locking).
>>
>> dav(s), google-drive and smb-share give another error:
>>
>> Error: (file-error "Doing chmod" "Operation not supported"
>> "/run/user/1000/gvfs/smb-share:server=detlef,share=netlogon/tmp/tramp-test1H01tS")
>>
>> So it doesn't make sense to implement the workaround in general. What we
>> could do instead is to map all files under "/run/user/%d/gvfs" to the
>> respective Tramp file name. Don't know whether it is worth the effort.
>>
>> After all, I believe we shall simply document the behavior, and the
>> workaround for ssh/sftp.
>
> If we cannot fix this, then documenting sounds good to me.  In
> etc/PROBLEMS, perhaps?

I've assembled the appended patch. This includes setting of the
safe-local-variable property of create-lockfiles, 'cos it doesn't hurt.

Comments?

[Message part 2 (text/plain, inline)]
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index c0d30ae5b4..836537bc5f 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1183,6 +1183,23 @@ always) doesn't insert the whitespace of the killed and yanked line.

 The solution is to set the GPaste "trim items" option to OFF.

+*** Gnome: Navigation from Nautilus to remote files.
+
+If you navigate to a file in Nautilus via "Open With Emacs", which
+belongs to a remote server, you might not be able to save this file
+once you have modified it in Emacs. The reasons for failing are
+different, and for some connection methods it might even be possible.
+
+If the remote connection in Nautilus uses ssh or sftp, you could
+mitigate the problem by the following lines in your .emacs file:
+
+(dir-locals-set-class-variables 'gvfs '((nil . ((create-lockfiles . nil)))))
+(dir-locals-set-directory-class (format "/run/user/%d/gvfs" (user-uid)) 'gvfs)
+
+A better approach might be to avoid navigation from Nautilus to Emacs
+for such files, and to open the file in Emacs using Tramp remote file
+name syntax.
+
 *** KDE: When running on KDE, colors or fonts are not as specified for Emacs,
 or messed up.

diff --git a/lisp/userlock.el b/lisp/userlock.el
index f077bc9ad6..209768620c 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -34,6 +34,9 @@

 (eval-when-compile (require 'cl-lib))

+;;;###autoload
+(put 'create-lockfiles 'safe-local-variable 'booleanp)
+
 (define-error 'file-locked "File is locked" 'file-error)

 ;;;###autoload
[Message part 3 (text/plain, inline)]
Best regards, Michael.

This bug report was last modified 5 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.