emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master cd7dd2e 1/5: Fix regression when on TRAMP hosts


From: Alexey Veretennikov
Subject: [elpa] master cd7dd2e 1/5: Fix regression when on TRAMP hosts
Date: Sat, 24 Sep 2016 17:52:13 +0000 (UTC)

branch: master
commit cd7dd2ecb61da2fce52189eb0020f0eefa4c4af8
Author: Philippe Vaucher <address@hidden>
Commit: Philippe Vaucher <address@hidden>

    Fix regression when on TRAMP hosts
---
 ztree-diff-model.el |   19 ++-----------------
 ztree-util.el       |   15 +++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/ztree-diff-model.el b/ztree-diff-model.el
index b4ad75f..25f9c26 100644
--- a/ztree-diff-model.el
+++ b/ztree-diff-model.el
@@ -138,21 +138,6 @@ RIGHT if only on the right side."
        (string-equal (ztree-diff-node-right-path node1)
                      (ztree-diff-node-right-path node1))))
 
-(defun ztree-diff-untrampify-filename (file)
-  "Return FILE as the local file name."
-  ;; FIXME: We shouldn't use internal Tramp functions.
-  (require 'tramp)
-  (declare-function tramp-tramp-file-p "tramp" (name))
-  (declare-function tramp-file-name-localname "tramp" (vec))
-  (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
-  (if (not (tramp-tramp-file-p file))
-      file
-    (tramp-file-name-localname (tramp-dissect-file-name file))))
-
-(defun ztree-diff-modef-quotify-string (x)
-  "Surround string X with quotes."
-  (concat "\"" x "\""))
-
 (defun ztree-diff-model-files-equal (file1 file2)
   "Compare files FILE1 and FILE2 using external diff.
 Returns t if equal."
@@ -160,8 +145,8 @@ Returns t if equal."
   ;; the same host.
   ;; FIXME: We assume that default-directory is also on the same host as
   ;; file(1|2).
-  (let* ((file1-untrampified (ztree-diff-untrampify-filename 
(ztree-diff-modef-quotify-string file1)))
-         (file2-untrampified (ztree-diff-untrampify-filename 
(ztree-diff-modef-quotify-string file2)))
+  (let* ((file1-untrampified (ztree-quotify-string (ztree-untrampify-filename 
file1)))
+         (file2-untrampified (ztree-quotify-string (ztree-untrampify-filename 
file2)))
          (diff-command (concat diff-command " -q" " " file1-untrampified " " 
file2-untrampified))
          (diff-output (shell-command-to-string diff-command)))
     (if (<= (length diff-output) 2) 'same 'diff)))
diff --git a/ztree-util.el b/ztree-util.el
index ec49457..17f6218 100644
--- a/ztree-util.el
+++ b/ztree-util.el
@@ -65,6 +65,21 @@ Used since `car-safe' returns nil for atoms"
     (insert text)
     (put-text-property start (point) 'face face)))
 
+(defun ztree-untrampify-filename (file)
+  "Return FILE as the local file name."
+  ;; FIXME: We shouldn't use internal Tramp functions.
+  (require 'tramp)
+  (declare-function tramp-tramp-file-p "tramp" (name))
+  (declare-function tramp-file-name-localname "tramp" (vec))
+  (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
+  (if (not (tramp-tramp-file-p file))
+      file
+    (tramp-file-name-localname (tramp-dissect-file-name file))))
+
+(defun ztree-quotify-string (str)
+  "Surround STR with quotes."
+  (concat "\"" str "\""))
+
 (provide 'ztree-util)
 
 ;;; ztree-util.el ends here



reply via email to

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