3

Emacs has a really nice mode for applying and navigating hunks of a diff file: Diff-Mode

However, there doesn't seem to be a way to apply the full diff when in this mode. Is this just so obvious that I missed it?

fommil
  • 1,750
  • 11
  • 24

1 Answers1

1

There doesn't seem to be a function that does that.

You can get that functionality by using a macro. First, hit F3 C-c C-a F4 to define a macro that applies a hunk, and then type C-u 0 M-x kmacro-call-macro to repeatedly call that macro until an error occurs (probably at the end of the diff file).

legoscia
  • 6,012
  • 29
  • 54
  • it'd be pretty nice if `Diff-Mode` was a single keystroke interface... no need for the `C-c C-` prefix. More magit-like. – fommil Jan 24 '16 at 12:11
  • 2
    If you put your diff in read-only mode, you get a few "single keystroke" shortcuts. WRT to a command applying the whole diff, I'd welcome a patch that implements it. – Stefan Jan 26 '16 at 04:26
  • @Stefan excellent! Where are the docs for read-only mode commands? I'd like to make diffs read-only by default. BTW, we're using diff-mode as the interface for refactorings in ensime :-) – fommil Jan 26 '16 at 09:02
  • 1
    `C-h f diff-mode-shared-map` and then follow the link to the source code. This map is bound to ESC (aka the Meta modifier) normally but is also used without prefix when the buffer is read-only. – Stefan Jan 26 '16 at 13:00
  • it must be `C-h v diff-mode-shared-map` because it is a variable and not a function. – Uwe Koloska Jul 08 '16 at 16:22