Closed Silex closed 10 years ago
I tested and it seems to work. The trick is that for most emacs operations work fine with a TRAMP filename (e.g directory-files
), but for the diff command shell-command-as-string
works directly over TRAMP and there you'd talk about local file names.
I don't understand the following:
How would you expect results from comparing remote files? It looks like you still comparing the local files.
No, the shell-command*
family work both locally and remotely. Before executing the command, if pwd
is from a TRAMP directory, shell-command*
forwards your command over the remote host, executes it there, and returns the result.
The untrampify part is to turn a path like /scpx:root@dev.stvs.ch:/root/foo/bar.txt
into /root/foo/bar.txt
, that way shell-command-as-string is called like (shell-command-as-string "diff -q /root/foo/bar.txt")
instead of (shell-command-as-string "diff -q /scpx:root@dev.stvs.ch:/root/foo/bar.txt")
Basically, both shell-command
and directory-files
are smart about TRAMP but they are not compatible in their smartness. shell-command
does its magic transparently by looking at pwd
, while directory-files
handles paths with protocols like scpx://
or ssh://
etc.
Ok, then please add (require 'tramp) to be able to perform the ztree-diff from default emacs
Done :wink:
Thanks, merged.
:+1:
Fixes #7