[darcs-users] tip: view dpatch files with emacs diff-mode

Trent W. Buck trentbuck at gmail.com
Tue Aug 12 05:02:49 UTC 2008


Simon Michael <simon at joyful.com> writes:
> Context: sometimes your mail client doesn't inline dpatch files
> (because they don't have text/x-darcs-patch content type) and you need
> to save the file and view it. Or it's a big patch and you need all the
> help you can get to read it. Or you're previewing one before sending
> it.
>
> Emacs diff-mode works well for viewing darcs patch files, making the
> actual code changes distinct from the rest. Add this to your .emacs:
>
> (add-to-list 'auto-mode-alist '("\.dpatch$" . diff-mode))

That should read

    (add-to-list 'auto-mode-alist '("\\.dpatch\\'" . diff-mode))

to avoid matching files like "badpatch" and "haxor.dpatch\nrm -rf /".



More information about the darcs-users mailing list