0

After creating a split window and using dired in each, how do I run diff to compare two files?

I have looked but haven't found any clear explanation.

0

2 Answers 2

0

Not clear what you're asking.

But in Dired, provided you've loaded (e.g. required) library dired-aux.el, you can use = (or menu Immediate > Diff), which runs command dired-diff, to diff the file listed on the current line against another file, for which you're prompted.


If you use library Dired+ (dired+.el), then = runs command diredp-ediff instead:

= runs the command diredp-ediff (found in dired-mode-map), which is an interactive compiled Lisp function in dired+.el.

It is bound to =, menu-bar immediate ediff.

(diredp-ediff FILE2)

Compare file at cursor with file FILE2 using ediff.

FILE2 defaults to the file at the cursor as well. If you enter just a directory name for FILE2, then the file at the cursor is compared with a file of the same name in that directory. FILE2 is the second file given to ediff; the file at the cursor is the first.

Try to guess a useful default value for FILE2, as follows:

  • If the mark is active, use the file at mark.

  • Else if the file at cursor is a autosave file or a backup file, use the corresponding base file.

  • Else if there is any backup file for the file at point, use the newest backup file for it.

  • Else use the file at point.

0

I find using ediff the easiest way to compare 2 files

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.