(diff-mode-hook): Make it a defcustom. Add some options.
(diff-mode-map): Bind diff-refine-hook.
(diff-yank-handler): New var.
(diff-yank-function): New fun.
(diff-font-lock-keywords): Use them.
(diff-end-of-file): Handle case where file-header looks like diff text.
(diff-hunk-kill): Adjust to "new" hunk-next behavior.
(diff-file-kill): Delete a subsequent empty line, if applicable.
(diff-hunk-file-names): New fun, extracted from diff-tell-file-name.
(diff-find-file-name): Use it.
(diff-tell-file-name): New command.
(diff-mode): Be careful with view-mode.
(diff-delete-if-empty, diff-delete-empty-files, diff-make-unified):
New functions, for use in diff-mode-hook.
(diff-find-source-location): Catch "regex too large" errors.
(diff-apply-hunk, diff-test-hunk): Go to old or new file.
(diff-refine-hunk): New command.
(diff-after-change-function): Fix typo.
(diff-post-command-hook): Take care of edge cases.
(diff-current-defun): Do `goto-char' after setting the mode.
(diff-hunk-kill): Simplify.
(diff-post-command-hook): Only apply to a single hunk.
(diff-hunk-text): Make `char-offset' non-optional.
(diff-find-text): Return a cons cell.
(diff-find-approx-text): New fun.
(diff-find-source-location): Use it.
(diff-apply-hunk, diff-test-hunk, diff-goto-source):
Adapt to new retval of diff-find-source-location.
Add specific setting for dark background.
(diff-context-face): Renamed from diff-comment-face.
Set explicitly rather than inheriting from font-lock-comment-face.
(diff-test-hunk, diff-apply-hunk): Remove unneeded `let'.
(diff-test-hunk): Make the return value agree with the doc string.
(diff-apply-hunk): Only advance if `diff-advance-after-apply-hunk'.
(diff-advance-after-apply-hunk): New variable.
(diff-hunk-text): Correctly use offsets rather than buffer-positions.
(diff-xor): New function.
(diff-find-source-location): Use it. Fix a stupid name clash.
(diff-hunk-status-msg): New function.
(diff-apply-hunk): Drop args OTHER-FILE, DRY-RUN, POPUP and NOERROR.
(diff-test-hunk): Use diff-find-source-location.
(diff-goto-source): Favor the `reverse'.
(diff-mode): Add support for add-log.el.
(diff-hunk-text): Use char offsets rather than line offsets.
(diff-find-source-location): Replace LINE with line-offset (nil
if not found) and always set POS to a meaningful position.
Adapt to the new char-offsets.
(diff-apply-hunk): Drop support for the unused `select' POPUP.
Adapt to the new diff-find-source-location.
(diff-goto-source): Adapt to the new diff-find-source-location.