File: diff-mode.el.html
Provides support for font-lock, outline, navigation commands, editing and various conversions as well as jumping to the corresponding source file.
Inspired by Pavel Machek's patch-mode.el (<pavel@@atrey.karlin.mff.cuni.cz>)
Some efforts were spent to have it somewhat compatible with
compilation-minor-mode(var)/compilation-minor-mode(fun).
Bugs:
- Reverse doesn't work with normal diffs.
Todo:
- Improve diff-add-change-log-entries-other-window,
it is very simplistic now.
- Add a delete-after-apply so C-c C-a automatically deletes hunks.
Also allow C-c C-a to delete already-applied hunks.
- Try diff <file> <hunk> to try and fuzzily discover the source location
of a hunk. Show then the changes between <file> and <hunk> and make it
possible to apply them to <file>, <hunk-src>, or <hunk-dst>.
Or maybe just make it into a ".rej to diff3-markers converter".
Maybe just use wiggle (by Neil Brown) to do it for us.
- in diff-apply-hunk, strip context in replace-match to better
preserve markers and spacing.
- Handle diff -b output in context->unified.
Defined variables (33)
diff--cached-revision-buffers | List of ((FILE . REVISION) . BUFFER) in MRU order. |
diff-add-log-use-relative-names | Use relative file names when generating ChangeLog skeletons. |
diff-advance-after-apply-hunk | Non-nil means ‘diff-apply-hunk’ will move to the next hunk after applying. |
diff-ask-before-revert-and-kill-hunk | If non-nil, ‘diff-revert-and-kill-hunk’ will ask for confirmation. |
diff-auto-refine-mode | Non-nil if Diff-Auto-Refine mode is enabled. |
diff-auto-refine-mode-hook | Hook run after entering or leaving ‘diff-auto-refine-mode’. |
diff-default-directory | The default directory where the current Diff buffer was created. |
diff-default-read-only | If non-nil, ‘diff-mode’ buffers default to being read-only. |
diff-font-lock-prettify | If non-nil, font-lock will try and make the format prettier. |
diff-font-lock-syntax | If non-nil, diff hunk font-lock includes source language syntax highlighting. |
diff-ignore-whitespace-switches | Switch or list of diff switches to use when ignoring whitespace. |
diff-jump-to-old-file | Non-nil means ‘diff-goto-source’ jumps to the old file. |
diff-minor-mode | Non-nil if Diff minor mode is enabled. |
diff-minor-mode-hook | Hook run after entering or leaving ‘diff-minor-mode’. |
diff-minor-mode-map | Keymap for ‘diff-minor-mode’. See also ‘diff-mode-shared-map’. |
diff-minor-mode-prefix | Prefix key for ‘diff-minor-mode’ commands. |
diff-mode-abbrev-table | Abbrev table for ‘diff-mode’. |
diff-mode-hook | Run after setting up the ‘diff-mode’ major mode. |
diff-mode-map | Keymap for ‘diff-mode’. See also ‘diff-mode-shared-map’. |
diff-mode-menu | Menu for ‘diff-mode’. |
diff-mode-read-only | Non-nil when read-only diff buffer uses short keys. |
diff-mode-shared-map | Additional bindings for read-only ‘diff-mode’ buffers. |
diff-mode-syntax-table | Syntax table for ‘diff-mode’. |
diff-read-only-map | Additional bindings for read-only ‘diff-mode’ buffers. |
diff-refine | If non-nil, enable hunk refinement. |
diff-refine-nonmodified | If non-nil, also highlight the added/removed lines as "refined". |
diff-refine-threshold | Maximum size of diff hunk that can be automatically refined. |
diff-update-on-the-fly | Non-nil means hunk headers are kept up-to-date on-the-fly. |
diff-use-changed-face | Controls how changed lines are fontified in context diffs. |
diff-valid-unified-empty-line | If non-nil, empty lines are valid in unified diffs. |
diff-vc-backend | The VC backend that created the current Diff buffer, if any. |
diff-vc-revisions | The VC revisions compared in the current Diff buffer, if any. |
diff-whitespace-style | Specify ‘whitespace-style’ variable for ‘diff-mode’ buffers. |
Defined functions (87)
Defined faces (18)
diff-added | ‘diff-mode’ face used to highlight added lines. |
diff-changed | ‘diff-mode’ face used to highlight changed lines. |
diff-changed-unspecified | ‘diff-mode’ face used to highlight changed lines. |
diff-context | ‘diff-mode’ face used to highlight context and other side-information. |
diff-error | ‘diff-mode’ face for error messages from diff. |
diff-file-header | ‘diff-mode’ face used to highlight file header lines. |
diff-function | ‘diff-mode’ face used to highlight function names produced by "diff -p". |
diff-header | ‘diff-mode’ face inherited by hunk and index header faces. |
diff-hunk-header | ‘diff-mode’ face used to highlight hunk header lines. |
diff-index | ‘diff-mode’ face used to highlight index header lines. |
diff-indicator-added | ‘diff-mode’ face used to highlight indicator of added lines (+, >). |
diff-indicator-changed | ‘diff-mode’ face used to highlight indicator of changed lines. |
diff-indicator-removed | ‘diff-mode’ face used to highlight indicator of removed lines (-, <). |
diff-nonexistent | ‘diff-mode’ face used to highlight nonexistent files in recursive diffs. |
diff-refine-added | Face used for added characters shown by ‘diff-refine-hunk’. |
diff-refine-changed | Face used for char-based changes shown by ‘diff-refine-hunk’. |
diff-refine-removed | Face used for removed characters shown by ‘diff-refine-hunk’. |
diff-removed | ‘diff-mode’ face used to highlight removed lines. |