Next: , Previous: , Up: Editing   [Index]


8.15 Comparing-Diffing-Merging

Diff Mode

M-x diffcommand produces Diff mode, which displays the differences between two files in a ‘*diff*’ buffer through running the diff program. Switches are found in the diff-switches variable (the default is ‘-u’, a unified context diff).

Ediff Package

Ediff is a more sophisticated alternative to Diff mode. See (ediff)Top.

Comparing a File to a Backup

M-x diff-backup’ compares a file with its most recent backup. If you specify the name of a backup file, this command compares it with the source file instead. Otherwise, it is the same as ‘M-x diff’.

Compare a Buffer with its File

M-x diff-buffer-with-file’ compares a specified buffer with its corresponding file. This shows you what changes you would make to the file if you save the buffer.

Compare Windows

M-x compare-windows’ compares the text in the current window with that in the window that was the selected window before you selected the current one.

Smerge Mode

M-x smerge-mode’ turns on Smerge mode, a minor mode for editing output from the ‘diff3’ program.

Emerge

The Emerge commands compare two files or buffers, and display the comparison in three buffers: one for each input text (the “A buffer” and the “B buffer”), and one (the “merge buffer”) where merging takes place. The merge buffer shows the full merged text, not just the differences. Wherever the two input texts differ, you can choose which one of them to include in the merge buffer.

M-x emerge-files

to merge two specific files.

M-x emerge-files-with-ancestor

to merge two files with reference to a common ancestor.

M-x emerge-buffers

to merge two buffers

M-x emerge-buffers-with-ancestor

to merge two buffers with reference to a common ancestor in a third buffer.


Next: Entering Special Symbols, Previous: Quoted Insert, Up: Editing   [Index]