Questions tagged [diff-mode]
The diff-mode tag has no summary.
24 questions
0 votes
2 answers
185 views
diff two files in two windows
After creating a split window and using dired in each, how do I run diff to compare two files? I have looked but haven't found any clear explanation.
1 vote
0 answers
97 views
diff-mode: how to highlight whitespace characters?
with emacs -Q, I can use M-x whitespace-mode : But in diff-mode, if I use M-x whitespace-mode this is what I get: you can see the tabs/space/newlines aren't shown (highlighted). How can I make diff-...
1 vote
0 answers
48 views
whitespace-mode does not display hidden characters in a patch file
I have a patch file on which if I do cat -A , I get : if (zif->rtadv.AdvIntervalOption)$ {$ struct nd_opt_adv_interval *ndopt_adv = $ ^I(struct nd_opt_adv_interval *)(buf + len);$ But ...
1 vote
0 answers
75 views
diff-text-hunk : Hunk text not found but patch -p0 works as intended with the same patch file
When I go to my hunk and use diff-text-hunk, I see in minibuffer and Messages : Hunk text not found or with another command : diff-apply-hunk: Can’t find the text to patch But if I try on terminal ...
0 votes
1 answer
234 views
How to stage selected lines / hunks in diff-mode?
Is it possible to stage changes in diff-mode? Or is this only possible with magit+ediff?
1 vote
1 answer
151 views
Can magit stage a hunk / selected lines in 'diff-mode'?
Is it possible to stage the current hunk or selected lines of the hunk in diff-mode? For example, when in diff-mode, what command can I run to stage the current hunk?
6 votes
3 answers
2k views
Is it possible to revert a hunk in diff-mode?
With viewing a diff for a modified working copy, is there a way to revert the hunk under the cursor? That is, reverse the change shown in the diff, making the changes to source-file the diff refers ...
1 vote
1 answer
309 views
How to diff against a git branch?
I'm currently using (vc-root-diff nil) however, I'd like to spesify a branch. Calling (vc-root-diff t) prompts for the revision, and the path. Is there a way to diff against a branch without, ...
3 votes
1 answer
139 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 ...
7 votes
1 answer
1k 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 ...
5 votes
1 answer
216 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 ...
2 votes
2 answers
1k 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 ...
4 votes
1 answer
1k 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
1 answer
93 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 @@
2 votes
1 answer
351 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 ...