I need to compare from time to time the contents (source code) of a remote directory with a local one. And I would like to mark for hiding those files/subdirs that are identical (that is, use the
=h command). But in the list of diff sessions, the remote files are marked as
*remote file* instead of appearing the time stamp, and
=h does simply nothing.
I found a hack in the web, to try to handle this situation (in fact, to handle tramp and ediff interaction). The code is:
(defun ediff-listable-file (file-name) (let ((handler (find-file-name-handler file-name 'file-local-copy))) (or (null handler) (eq handler 'dired-handler-fn) (eq handler 'tramp-file-name-handler)))) (defun ediff-same-file-contents (f1 f2) "Return t if files F1 and F2 have identical contents." (if (and (not (file-directory-p f1)) (not (file-directory-p f2))) (let ((res (apply 'call-process ediff-cmp-program nil nil nil (append ediff-cmp-options (list (if (tramp-tramp-file-p f1) (tramp-handle-file-local-copy f1) f1) (if (tramp-tramp-file-p f2) (tramp-handle-file-local-copy f2) f2)))))) (and (numberp res) (eq res 0)))))
The problem with this code is that with command
=h I get now the error message
Symbol's function definition is void: tramp-handle-file-local-copy, meaning that the mentioned function is not existing.
Could anybody please help me with this? I'm using GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) (with Prelude Emacs configuration).
As pointed out by the selected answer contributor, the problem is the Prelude environment. I have tried to find out were to touch without generating a disaster, and I found that Projectile might be the problem. But, after updating the Prelude configuration system (with a simple
git update in
.emacs.d), everything seems to work nicely, including the
ediff-directories and the
Sorry, I shoud have tried that first!