From 2f9b85855bff4a6a35edacc776336425f76eea64 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Thu, 10 Jan 2019 18:06:54 +0200 Subject: [PATCH] emacs: tramp: detect wrapped gvfsd-fuse daemon Tramp checks for a running `gvfsd-fuse` process to figure out whether to enable gvfs-based. Its `tramp-compat-process-running-p` function uses `/proc//comm` to check for the name of running process(es). In Nix, the gvfsd processes are launched via wrappers and the name of `gvfsd-fuse` in `comm` in Linux is `.gvfsd-fuse-wra` (truncated to 15 characters) which means the process is not detected and `tramp-gvfs-enabled` ends up with `nil` even when gvfs is available. This patch adds `.gvfsd-fuse-wrapped` to the list of process names to check when determining the value of `tramp-gvfs-enabled`. --- pkgs/applications/editors/emacs/default.nix | 1 + .../editors/emacs/tramp-detect-wrapped-gvfsd.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 948d8cb9867..4f268a3a104 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -42,6 +42,7 @@ stdenv.mkDerivation rec { patches = [ ./clean-env.patch + ./tramp-detect-wrapped-gvfsd.patch ]; postPatch = lib.optionalString srcRepo '' diff --git a/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch b/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch new file mode 100644 index 00000000000..5d16194fd20 --- /dev/null +++ b/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch @@ -0,0 +1,14 @@ +diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el +index f370abba31..f2806263a9 100644 +--- a/lisp/net/tramp-gvfs.el ++++ b/lisp/net/tramp-gvfs.el +@@ -164,7 +164,8 @@ tramp-gvfs-enabled + (and (featurep 'dbusbind) + (tramp-compat-funcall 'dbus-get-unique-name :system) + (tramp-compat-funcall 'dbus-get-unique-name :session) +- (or (tramp-compat-process-running-p "gvfs-fuse-daemon") ++ (or (tramp-compat-process-running-p ".gvfsd-fuse-wrapped") ++ (tramp-compat-process-running-p "gvfs-fuse-daemon") + (tramp-compat-process-running-p "gvfsd-fuse")))) + "Non-nil when GVFS is available.") +