2

I want to compare two directories which have similar hierarchy.

With "M-x ediff-directories" within Emacs, I was prompted to input a regexp to constrain the name of files I want to compare. For example, I want to compare the files whose name ends with .c or .h. Then I input ".*.[ch]", However, I find that it only take effects on the top level directory, but i want the regexp take effects on the files lied in all the sub-directories, no matter what the depth it is.

Any idea?

1 Answer 1

0

As I recall, edif-dirs is not recursive. I haven't tried it myself, but this package seems to do what you want:

The EdiffTrees package is a simple frontend to EdiffMode to allow a simpler comparison of two similar directory trees.

I wrote this package because I often need to compare two different versions of the same directory tree and ediff-directories is not very helpful in this case. Specially when the directory trees to compare are deep and only a few files have changed.

For further instructions, please see the comentary in the file.

Alternatively, assuming you are on a unix-like OS, you can go into eshell mode (M-x eshell), and run:

diff -r dir1 dir2

Kind of a hack really, but hey, you're still in emacs!

2
  • diff -r, that's too un-emacs, :P
    – hero2008
    Commented Aug 16, 2012 at 6:33
  • Heh, I know I know, but technically eshell is still in emacs your honor, I swear! :)
    – terdon
    Commented Aug 16, 2012 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .