Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [diff-mode]

The tag has no usage guidance.

2
votes
1answer
44 views

Syntactic fontification of diff hunks

I'm looking for a multiple-major-modes package that doesn't remove fontification of the host mode from its inner submodes? I tried MMM Mode and Polymode, but they remove the initial fontification and ...
5
votes
1answer
82 views

Is there a way to revert only certain lines from a diff hunk?

I use the builtin VC package and it's very nice that when I do a diff of changes in the current file then I can revert any hunk in the diff quickly with C-a But sometimes I don't want to revert the ...
1
vote
0answers
29 views

How to jump to the current file & line when opening a diff?

When viewing a diff of the entire repository (using vc-root-diff for example). Is it possible jump to the current file:line in the diff?That is - the file:line visible before the diff was opened. ...
5
votes
1answer
52 views

diff-mode use fringes

So currently diff-mode outputs standard git patches, something like @@ -8,6 +8,8 @@ -foo bar +baz I.e. the + and - are part of the buffer text. Sometimes I would find it convenient if the +/- was ...
1
vote
2answers
103 views

Change colours for character differences for diff-mode

I've changed my diff-mode colours according to this article, but the character-based differences are shown in the original(?) and very bright colours, making them quite unreadable. How do I change ...
3
votes
1answer
87 views

Jump to file and line number in grep file

$ grep -nrH would . | tee file.txt $ emacs file.txt If I have a buffer with grep search results, how can I make Emacs jump to the file and line number on the cursor line, similar to diff-goto-source ...
1
vote
1answer
46 views

Enable diff-mode for files with diff-ish content

How do I make Emacs automatically turn on diff-mode for any file with diff-looking content, eg. --- a.txt +++ b.txt @@ -1234,56 +1234,56 @@
1
vote
1answer
114 views

how to deal with mixed line endings in diff-mode

Say I have several files with different line endings (i.e. some have LF and others have CR+LF). If I somehow run diff on them and load the diff into Emacs (e.g. with C-x v D, or just dumping the diff ...
0
votes
1answer
69 views

How to delete a diff buffer, after running 'Jump to source'?

Id like to use a diff on my repository to quickly navigate changes, without keeping the buffer open. Is it possible to make a function that runs 'Jump to source', and deletes the diff buffer? (Am ...
1
vote
1answer
173 views

diff-refine-hunk with unified diff

Problem Some versions of diff (notably, busybox diff in every build of BusyBox I've seen) only produce "unified" diff format output, they don't produce the output that GNU diff produces by default. ...
1
vote
2answers
246 views

diff-mode: refine all hunks when opening a diff file?

diff-mode provides diff-refine-hunk function to refine the highlighting of the current hunk. However, by default, only diff-hunk-next or explicit diff-refine-hunk calls will do this job -- hunks will ...
4
votes
1answer
68 views

Sexp-diff like mode for elisp source diffing

diff-mode shows differences by lines. I'm looking for a mode that could show a diff knowing that the diffed files are elisp sources, so they are full of sexps and therefore more specialized diff ...
2
votes
2answers
315 views

how to properly capture `diff` output in buffer (without first opening a file)?

summary If one captures diff output to a file name=*.diff and opens that file in a buffer, one gets nicely-formatted mode=Diff. How to get that directly, without first capturing to a file? details ...
4
votes
1answer
185 views

apply full diff in Diff-Mode?

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 ...
1
vote
2answers
1k views

ediff - change colors and how to merge code

first question: is how to adjust colors of ediff-revision output, tried various versions - no luck: ;; Customizing colors used in diff mode (load-library "ediff") (setq ediff-window-setup-function '...
16
votes
2answers
10k views

How to show a diff between two buffers with “character-level” diffs

When two buffers are compared for differences, M-x ediff-buffers does not indicate the specific characters that have changed within a word (ie "character-level" diffs). Most modern diff tools will ...
9
votes
2answers
569 views

Override `show-trailing-whitespace` in `diff-mode`

I have show-trailing-whitespace set to t globally in my .emacs file, and this is generally not a problem except for when I'm in diff-mode looking at a patch which has mandatory trailing white space ...