an Emacs package for fast arbitrary diffs
Emacs Lisp Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
media update screenshot to one with more content Aug 28, 2017
test add `test-dumb-diff-write-to-file` test Aug 25, 2017
.ert-runner test running boilerplate Aug 21, 2017
.gitignore
.travis.yml add travis.yml Sep 13, 2017
Cask
LICENSE Initial commit Aug 11, 2017
Makefile test running boilerplate Aug 21, 2017
README.md
dumb-diff.el

README.md

dumb-diff

Build Status MELPA

Dumb Diff Screenshot

About

Dumb Diff is an Emacs package for fast arbitrary diffs.

Calling dumb-diff will create two comparison buffers on top and one result buffer on the bottom. Every time you call dumb-diff it will update the result buffer and show the UI. You can use dumb-diff-set-region-as-buffer1 and dumb-diff-set-region-as-buffer2 to copy the content of selected regions directly into the buffer without needed to call dumb-diff first.

Why?

I often need to see the diff of arbitrary content that is either not in a file or is only part of one. For instance, I'll have a string somewhere in a file, and then someone will send me an edit for it. I have often found this situation awkward, so I made this. Similar functionality is somewhere in the ediff package and elsewhere. See alternatives.

How it works?

Dumb Diff uses your built-in diff program against dynamically created temporary files. The diff binary and its arguments are customizable via dumb-diff-bin-path and dumb-diff-bin-args.

Installing

It's available on MELPA: M-x package-install dumb-diff

.emacs options

  • (setq dumb-diff-on-set-show-diff-only t) If using a set-region-as-bufferN, when t will only show the diff result buffer while nil will show the comparison buffers and diff result buffer. (defaults to t)
  • (setq dumb-diff-clear-buffers-on-quit t) When t, quitting dumb diff will clear the comparison and result buffers. (defaults to t)

use-package example configuration.

(use-package dumb-diff
  :bind (("C-c d" . dumb-diff)
         ("C-c 1" . dumb-diff-set-region-as-buffer1)
         ("C-c 2" . dumb-diff-set-region-as-buffer2)
         ("C-c q" . dumb-diff-quit))
  :ensure t)

I personally use use-package together with hydra.

Alternatives

Potential alternative packages for emacs: