Skip to main content

Questions tagged [ediff]

Ediff is a feature of Emacs which allows comparing two or more files or buffers, as well as merging two files or buffers into one.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How to setup ediff-merge-files to interactively either save the mergebuffer or abort the merging when calling from the command line

I want to merge the two files $FILE1 and $FILE2 via emacs(client) into a $FILE3 on the command line with a way to abort the merge. I tried emacsclient --eval '(ediff-merge-files "'$FILE1'" &...
halloleo's user avatar
  • 1,345
1 vote
1 answer
25 views

How to set truncate-lines for both files in ediff mode

I use a default .emacs line to truncate lines (setq truncate-lines t) However, for ediff mode I want to see the entire line for both files being compared. Have been toggling manually at each ediff ...
glendeni's user avatar
0 votes
0 answers
29 views

ediff broken on emacs 27.1?

I had no problem with ediff for years (decades, actually). However, a couple of years ago it started behaving badly. I'm not sure exactly when, but possibly when I started using Ubuntu. I'm now mostly ...
QF0's user avatar
  • 103
0 votes
0 answers
48 views

Doesn't automatically jump to different characters in both buffers

Emacs 27.1 I want to find differents between 2 buffers. I use command ediff-buffers Steps: Type the n in the Ediff Control Panel Again Type the n in the Ediff Control Panel And because the line is ...
a_subscriber's user avatar
  • 4,174
0 votes
1 answer
43 views

Automatically merge files

When opening an A file, I'd like to check if there's a conflicting file B that follows some naming convention. If this happens, I'd like to transparently merge the content of B in A, keeping an ...
cidra's user avatar
  • 139
0 votes
0 answers
18 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 ...
xpt's user avatar
  • 477
0 votes
1 answer
56 views

Modern Emacs keeps opening related file from vc-diff buffer

Initially I opened Lags when navigating vc-root-diff buffer and the cause of slowness was Emacs opening referenced files by diff. Back then I used Emacs 27.1. Now I'm on Emacs 28.2 and previous ...
gavenkoa's user avatar
  • 3,462
0 votes
1 answer
16 views

Ediff Changes Window Title

Before I launch ediff, emacs has this window title 0x08e000ac 0 spartacus scratch.spartacus.org - GNU Emacs at spartacus , but after launch it has this x08e01bc4 0 spartacus *Ediff Control Panel* ...
Jason Hunter's user avatar
0 votes
2 answers
55 views

How to change the binding of "?" on the help command in ediff-mode?

I am willing to learn how to use ediff-mode. One of the reasons that I am struggling is because I need to ask for help which is bound to ?. Unfortunately, I am having a hard time with ? on an American ...
Pedro Delfino's user avatar
1 vote
1 answer
21 views

Is it necessary to save buffers as files in order to use command highlight-compare-buffer?

Based on a nice comment from @Drew on this previous question, I tried to use the command highlight-compare-buffers (although he did not mention exactly this comment). My first attempt was actually ...
Pedro Delfino's user avatar
0 votes
1 answer
86 views

Ediff update highlighting after edits and ediff-copy

When using ediff, I find it annoying that when I use a or b to copy from one buffer to another, the region remains highlighted despite the fact that the two files now match in those regions. I don't ...
farnsy's user avatar
  • 161
1 vote
0 answers
34 views

Automatically change ediff-diff-options based on buffer mode of targets

I use ediff all the time and have ediff-diff-options set to -wBb. This works most of the time but I've gotten burned diff-ing some Python scripts and the occasional makefile since whitespace matters ...
David R's user avatar
  • 21
0 votes
1 answer
44 views

My tiling window manager is crashing with ediff-mode window creation. How to fix it?

I am using Material Shell which is a tiling window manager created as an extension of GNOME Desktop Environment. After an interactive rebase in Magit, a merge conflict happened. Thus, to fix it, I ...
Pedro Delfino's user avatar
1 vote
0 answers
28 views

Erratic Next behavior with ediff-buffers

We recently switched from Cinnamon to Gnome, and ever since then I have seen erratic behavior with ediff-buffers, whereby hitting n (Next) no longer reliably jump to the next change. It would ...
mkwongh2g2's user avatar
1 vote
1 answer
141 views

How to use ediff with JSON, so it abstracts from member order in objects?

Currently I use ediff a lot for diffing all sorts of text files. I also use it for looking at diffs between JSON files. The problem is that a lot of differences appear which are semantically ...
Richard Wheeldon's user avatar
1 vote
0 answers
186 views

Output side-by-side ediff to html

Vim has a command :tohtml which is particularly useful when sharing side-by-side diffs to non-programmers - they can open the resulting html file to see the results of a vimdiff. In emacs I use ediff ...
hubris's user avatar
  • 11
1 vote
0 answers
155 views

Magit ediff range in a pretty way?

I need to investigate a project, with a patch made by a former student of my university. He made a series of commits on a repo, and I need to see what additions he made. I got the list of files ...
Alessandro Bertulli's user avatar
0 votes
1 answer
152 views

MAGIT: easier to read diffs

Is there a way in MAGIT to see diffs as one line instead of two with deletions and additions in one line? It would be much easier to navigate.
Emmanuel Goldstein's user avatar
0 votes
0 answers
195 views

Can ediff be used to view an existing diff/patch?

Given an existing patch (for example, git show -c > my.diff; emacs my.diff) Most of the commands that are part of ediff rely on having both source & destination available, or referencing ...
ideasman42's user avatar
  • 8,846
1 vote
1 answer
32 views

How to provide my own ediff-make-wide-display-function for ediff

For Ediff's wide display feature I like to use my own ediff-make-wide-display function. Ediff has a variable for this: ediff-make-wide-display-function. However when I write: (defun my-ediff-make-wide-...
halloleo's user avatar
  • 1,345
1 vote
1 answer
467 views

Ediff in one frame

I want to start Ediff in a single frame the way pacfiles does: Right now it opens the control panel in a separate frame.
mcp's user avatar
  • 556
0 votes
0 answers
45 views

How to search only the difference region's while using ediff command?

While viewing diff b/w 2 files using ediff command, i want to search for a string only in the difference region. What is the right way to this? EDIT: added clarification
Talespin_Kit's user avatar
2 votes
0 answers
19 views

Show different on the specific chars

Linux Mint 20, Emacs 27.2 I compare two files by ediff Here result: As you can see the ediff show different on the specific line. But... I need to see different in the specific chars (A and Z). I ...
a_subscriber's user avatar
  • 4,174
1 vote
1 answer
221 views

How to setup ediff to open a new frame with the two comparison buffers

When I issue M-x ediff-buffersI'd like ediff to create a new frame with the two buffers (and close this frame when done with the comparison). How can I customise ediff to do so? I tried (defun leo-...
halloleo's user avatar
  • 1,345
1 vote
1 answer
308 views

While merging, how to tell Magit to use one version of the file?

When I merge something and there are conflicts, I can go to the file in the magit status page (SPC-g-s) and press, for example, e to start ediff. Within that, I can scroll through all conflicts and ...
SwiftedMind's user avatar
0 votes
1 answer
203 views

How to efficiently merge 2 buffers which are partially overlapping?

Problem summary Imagine, you have 2 shopping lists: 1 huge one with hundreds of entries - list A, copied into buffer A 1 containing dozens of entries - list B, copied into buffer B Then: 75% of ...
starquake's user avatar
1 vote
1 answer
252 views

How to `ediff-buffer` with ansi-colors (script output)? `ediff-file` works!

Context: files with ANSI and other terminal color codes. I often record terminal transcripts using the traditional script program or expect. Colored ls output, colored grep matches, mc and other ...
Stéphane Gourichon's user avatar
0 votes
1 answer
187 views

How to abort an ediff merge?

I use ediff to merge mercurial conflicts (and sometimes git conflicts), but I can't seem to abort. Ediff pops up as soon as a conflict is detected, and quitting and not saving results in mercurial ...
Michael Chinen's user avatar
0 votes
3 answers
216 views

Finding missing key bindings

I was just looking at the Ediff manual¹ for something, and it's one of those Emacs manuals that (a bit annoyingly) only list keybinds and not function names (so, if you have rebinding going on, you ...
Trey's user avatar
  • 905
1 vote
1 answer
157 views

Merging diffs/hunks

When using ediff, I often get conflicts like this: <<<<<<< variant A added_function_1 () { ======= added_function_2 () { >>>>>>> variant B <<<<&...
Nova's user avatar
  • 1,119
0 votes
1 answer
212 views

Setting mode-line font size and Magit diff colours

I'd like to adjust the background colour of the part of the diffs displayed by Magit. In particular, the background colour of the text 1st, 2nd, and 3rd in the image. I'd like to increase the contrast ...
Adrian Pronk's user avatar
3 votes
1 answer
176 views

magit ediff conflicts wordwise

During a magit-rebase I'm running into conflicts on single long lines, where I'd like to take some parts of the line from the A and some from the B buffer. After hitting * -refine current region ...
lab's user avatar
  • 133
0 votes
1 answer
203 views

How do I do the key strokes `C-M-c` in spacemacs?

I'm using spacemacs but trying to use ediff-regions-linewise to compare a couple regions of text. In order to confirm the selection, I need to do C-M-c. This is probably a silly question, but how do ...
harumphfrog's user avatar
6 votes
3 answers
1k views

How can I diff two long lines from the same buffer?

When I run tests for my projects, failing tests produce output that looks something like this: expected: "..." but got: "..." The "..." are long lines that often only have small ...
Tikhon Jelvis's user avatar
1 vote
1 answer
984 views

emacs ediff show all buffer diff word-wise (like vimdiff)

Issue description When launching Ediff color scheme is very poor and i do not have word wise diff highlight. It seems that diff color faces are not activated at ediff startup. I use emacs -Q to ...
stockersky's user avatar
1 vote
1 answer
702 views

Ediff: compare two files Word-by-word

I use Emacs 26.1 and would like to compare two files word-by-word. Clicking "Tools -> Compare (Ediff) -> Windows Word-by-word..." allows only to compare the visible parts of two buffers, not the whole ...
user1876484's user avatar
2 votes
1 answer
594 views

Ediff: compare two (long) buffers Word-by-word

I use Emacs 26.1 and try to compare two (long) buffers (opened side by side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word... Then I choose both Windows (A and B) by clicking on each ...
user1876484's user avatar
0 votes
1 answer
109 views

How to get p4merge like view with the ediff?

In the p4merge tool the layout for merging 2 files look like the following. +---------------+--------------+ | | | | | | | ...
Talespin_Kit's user avatar
1 vote
1 answer
293 views

Unable to use ediff with emacs and evil due to window configuration

Running emacs 25.2.2 with evil installed and updated from Melpa. When I run ediff, it asks for usual buffer A and buffer B and then ONLY the ediff buffer in its own frame is visible with 'Type ? for ...
deshmukh's user avatar
  • 1,912
2 votes
1 answer
216 views

Find the first difference between two buffers

Given two buffers, how do I find the first character position where their contents differ? E.g. for contents abcdef and abcDeF, the first difference would be at point=4. For abc and ab, it would be at ...
Lassi's user avatar
  • 377
1 vote
1 answer
533 views

Is there a way for ediff to compare SVN changes in the head to my local copy?

My company uses SVN, and one of the things I often want to do is compare the differences that someone else checked in without doing an update. For example, if I see someone has committed a new ...
LivingDust's user avatar
3 votes
1 answer
556 views

Does magit when using ediff have a means for moving on the next file when there are multiple files to be diffed?

I am using ediff to get side by side diffs with magit and there seems to be no way to move to the next pair of files, after diffing the current file. For instance if I use vimdiff for git diff, after ...
vfclists's user avatar
  • 1,423
0 votes
1 answer
419 views

script to Ediff two files in running gui Emacs?

I'm putting together a presentation that involves some live demos in the terminal. In one of the demos, I run a shell script that takes an input file, runs it through an Awk script, and generates a ...
ivan's user avatar
  • 1,948
6 votes
2 answers
2k views

How to get back to ediff mode from edit mode

Bear with me as I am a neophyte to Emacs. I followed http://pragmaticemacs.com/emacs/visualise-and-copy-differences-between-files/ to fire up Ediff in Emacs. It opened two buffers in two windows ...
Black_Zero's user avatar
3 votes
1 answer
569 views

make ediff jump to closest difference

I use ediff-revision or vc-ediff to compare the current state of a file respect its working revision. I normally do not want to check the whole file but just the difference at or closest to the ...
ramestica's user avatar
3 votes
2 answers
643 views

Magit diff working file to commit in log?

How does one ediff a current file--ie working tree--against an arbitrary version in some previous commit? In this case, I'm interested in pulling in some, but not all, changes from a commit in ...
E Bro's user avatar
  • 133
1 vote
1 answer
97 views

How to view ediff (and other) manuals within emacs?

I want to learn how to use a built in package (e.g. ediff). This built-in package has an online manual in html, but presumably this content is also available from within emacs. How do I view it ...
cammil's user avatar
  • 509
2 votes
0 answers
170 views

Ediff: How to fill missing lines (gap) to achieve vertical alignment? [closed]

Oftentimes there are gaps in a side-by-side differential. That is some lines were added, some were removed. As I currently see it, ediff does not fill this gap by default. Thus, vertical alignment ...
Alexander Shukaev's user avatar
0 votes
1 answer
150 views

How to keep cursor position after calling ediff-current-file?

I would like to use ediff-current-file to jump to some of my previous changes/edits. However, when I type 'q' to quit ediff after calling ediff-current-file and navigation (using 'p'/'n'), the cursor ...
AhLeung's user avatar
  • 1,083
0 votes
1 answer
193 views

vdiff-refine-all-hunks/ediff-update-diffs in startup eval

I'm having a problem with putting vdiff-refine-all-hunks or ediff-update-diffs into --eval for startup. Take vdiff as example, I'm calling it using: emacs --eval "(progn (vdiff-files file1 file2) (...
phonycollectibles's user avatar