Show the difference between two files

How to implement functionality in emacs to show the difference between two files opened in two buffers? Kind of like revdiff when using mercurial.

+4
source share
4 answers

Emacs has ediff that can distinguish between two files. To use it, simply Mx ediff and specify the two files you want to split.

+10
source

By the way, if you want to see the differences between two blocks of text in the same buffer, you can do it as follows: - make sure that smerge mode is loaded (for example, Mx load-library RET smerge-mode RET ). - go to the beginning of the first block, C-SPC - go to the beginning of the second block, C-SPC - go to the end of the second block, Mx smerge-makeup-conflict RET - then you can use Cc ^ R or Cc ^ = to see the differences. Note that this works better if the two blocks are pretty much consistent.

+3
source
+1
source

I also found that comparison windows do an amazing job, cyclically changing the differences in open buffers.

0
source

Source: https://habr.com/ru/post/1495422/


All Articles