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)
                                  (if (tramp-tramp-file-p f2)
                                      (tramp-handle-file-local-copy 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 =h command.

Sorry, I shoud have tried that first!

1 Answer 1


Strange. I can compare two directories (local and remote), after starting emacs -Q. In the ediff buffer it shows me *remote file*, but it shows all files also which can be hidden after calling =h. Btw, I call usually =hx, in order to hide the superfluous files immediately.

Maybe your environment is in the way? Have you tried it with emacs -Q? My Emacs version is

GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.16.6) of 2015-09-17 on lgw01-52, modified by Debian

  • Thanks, Michael, you were right: it is the Prelude configuration. Now, I have to figure out why this does not work with Prelude... Commented Mar 18, 2016 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.