Questions tagged [diff-mode]
The diff-mode tag has no usage guidance.
25
questions
0
votes
1
answer
22
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.
0
votes
0
answers
10
views
splits the hunk in ediff mode
Is splitting the hunk in ediff mode possible?
diff-mode provides diff-split-hunk which splits the hunk at the current line. You can then apply, or reverse it with (C-u) diff-apply-hunk. Can be very ...
1
vote
0
answers
66
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
39
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
54
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
195
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
113
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
1k
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
222
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
106
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
984
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
175
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
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
881
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
73
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
315
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
1
answer
106
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
1
answer
389
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.
...
3
votes
2
answers
553
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 ...
3
votes
1
answer
134
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
2
answers
621
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
...
3
votes
1
answer
316
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 ...
2
votes
2
answers
3k
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-...
27
votes
2
answers
18k
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
2
answers
851
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 ...