Compare buffer with file on disk

Sometimes you’ll find yourself in the position where you want to see the differences between the unsaved buffer you are editing, and the saved version of the file on the disk. Ediff does this nicely with the command M-x ediff-current-file.

  • Phil

    Note that diff-buffer-with-file is also available, so you can use whichever one suits best in any situation. I use a custom wrapper for that, which let-binds (diff-switches "-u") so that the unified diff format is produced, and I have both this and the ediff version bound to keys (C-z = and C-z C-= respectively, as I use C-z as a prefix).

  • Pingback: Diff a Buffer with its On-Disk File | Irreal()