Skip to main content
15 votes
Accepted

How can I quit ediff immediately without having to type 'y'

You can advise ediff-quit so it dynamically rebinds y-or-n-p to a function that returns t. (defun disable-y-or-n-p (orig-fun &rest args) (cl-letf (((symbol-function 'y-or-n-p) (lambda (prompt) ...
Clément Lassieur's user avatar
10 votes

How can I compare two commit diffs in magit?

You can do it from the magit-log buffer M-x magit-log E r ref1..ref2
djangoliv's user avatar
  • 3,199
10 votes

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

Split the window. In each window, put point at the start of one of the two lines (or at the start of each "..." in your example). M-x compare-windows RET C-xzzzz... to repeatedly compare as many times ...
phils's user avatar
  • 51.7k
9 votes
Accepted

How to use both variants in Ediff?

See this StackOverflow answer. From @killdash9: Pressing d will copy both A and B to buffer C. (defun ediff-copy-both-to-C () (interactive) (ediff-copy-diff ediff-current-difference nil 'C ...
Tianxiang Xiong's user avatar
7 votes

Comparing two text files on a Windows system

If you have git for windows installed, then it is enough to add C:\Program Files\Git\usr\bin\ to your PATH, because it already ships with a diff executable and installs it in that folder.
FlyingFoX's user avatar
  • 181
6 votes

Launch emacs with ediff-files (of ediff-directories) from command line

I use the following script: it checks in advance if there are differences, and in case there are, it opens Emacs with the appropriate function evaluated. With the -d option, it assumes the items ...
J C Gonzalez's user avatar
5 votes
Accepted

How can I compare two commit diffs in magit?

Based on Kyle Meyer's comment to the OP -- thanks, Kyle. It seems that what you want is to see the diffs associated with the two commits in two separate magit-revision buffers. You can accomplish ...
kini's user avatar
  • 344
4 votes
Accepted

Diff of two buffers without creating temporary files

@tmalsburg, Following command calls diff on 2 buffers without the creation of temporary files. It uses named pipes as you suggested above: (require 'diff) (defun diff-buffers-without-temp-...
Tino's user avatar
  • 420
4 votes
Accepted

How can I resize certain windows evenly when using the golden-ratio library?

In fact the code at https://github.com/roman/golden-ratio.el/wiki for handling ediff mostly worked; I suspect it was just a little out of date with the current version of golden-ratio. It's updated ...
phils's user avatar
  • 51.7k
4 votes

Prevent folding org files opened by ediff

Another option can be found on the worg page. The basic idea is to use ediff-select-hook to unfold an element whenever given region is selected in ediff and folding them back in the ediff-unselect-...
Iqbal Ansari's user avatar
  • 7,588
4 votes
Accepted

How to get back to ediff mode from edit mode

Can you get to a buffer named *Ediff Control Panel*? If you cannot get to that buffer then either you have quit Ediff or you have deleted one of its "vital" buffers, and you will need to start Ediff ...
Drew's user avatar
  • 78k
4 votes
Accepted

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

You can use ediff-regions-wordwise for the whole buffers. The input of the regions is a bit daunting though. The following elisp snippet defines ediff-buffers-wordwise working like ediff-buffers. A ...
Tobias's user avatar
  • 33.3k
4 votes
Accepted

magit ediff conflicts wordwise

Good question. This feels like it should be standard. With a little digging into the code and experimenting, this seems at first glance to work: From the ediff control window: M-: (setq ediff-word-...
phils's user avatar
  • 51.7k
3 votes
Accepted

Find the first difference between two buffers

Why a binary search? compare-buffer-substrings returns the number of chars that were equal. So you can just do: (goto-char (+ (point-min) -1 (abs (compare-buffer-substrings ...
Stefan's user avatar
  • 26.5k
3 votes
Accepted

script to Ediff two files in running gui Emacs?

I use this to diff from bash. --eval is what I think you are looking for. If you are not using emacsclient you can adjust the first portion accordingly. ediff () { if [ -d $1 ]; then ...
eflanigan00's user avatar
3 votes

Comparing two text files on a Windows system

This may save people some time so I will answer here. If you do not wish to add the cygwin bin directory to your path (or any of the other ones suggested in the other answers), you can set the path of ...
sturgman's user avatar
  • 131
3 votes

How to kill ediff's buffers on quit?

I'm adding an answer because this is the first link that popped up for me on this topic, and this is indeed way simpler. You can pass a prefix to "q" and it will prompt to kill the ediff buffers. ...
Hoagie's user avatar
  • 31
3 votes

Never create frame in ediff

There is an internal predicate in ediff-init.el, called ediff-window-display-p. When I redefined it (after loading ediff, of course) like so, everything works in a single frame, including the ...
cyberbisson's user avatar
3 votes

Execute an ediff command while in one of the buffers

What you did would not work for various reasons. Firstly, because indeed the ediff-* variables and functions are only local to the control window, you cannot call those functions from another window. ...
ibizaman's user avatar
  • 261
3 votes

How to use both variants in Ediff?

Edit: The duplicate Q&A on StackOverflow has answers to this question (as pointed out by Tianxiang Xiong in the comments). My answer below is no use, as you evidentially can't get the desired ...
phils's user avatar
  • 51.7k
3 votes
Accepted

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

M-x customize-option RET ediff-window-setup-function RET Select "Single Frame". (Much better than the default, IMHO; especially in a tiling window manager, where the multi-frame config is all but ...
phils's user avatar
  • 51.7k
3 votes
Accepted

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

It is not a good idea to change the global map for this as this answer recommends: it affects far more than the binding that you want to change which is only valid inside the Ediff Control Panel ...
NickD's user avatar
  • 30.9k
2 votes

How to quickly reopen ediff with the same files

Yes, there is a quick way to repeat any complex command (that is, a command that uses the minibuffer to read input): C-x ESC ESC (aka C-x M-ESC), repeat-complex-command. That inserts the Lisp form of ...
Drew's user avatar
  • 78k
2 votes

How to kill ediff's buffers on quit?

I'm using this code (GNU Emacs 25.3.1 x86_64-pc-linux-gnu), following https://emacs.stackexchange.com/a/17089/18662 As stated in the GNU Emacs Manual regarding ediff-quit-hook (https://www.gnu.org/...
quimm2003's user avatar
  • 131
2 votes
Accepted

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

vdiff processes the output of diff asynchronously which takes a nonzero amount of time. Instead of guessing when to run vdiff-refine-all-hunks just set vdiff-auto-refine to t to let vdiff run it at ...
justbur's user avatar
  • 1,510
2 votes
Accepted

How to make ediff-patch-file strip leading path components?

If you read the code of ediff-patch-file, you will find it calls ediff-patch-file-internal which basically just calls GNU Patch (https://www.gnu.org/software/diffutils/manual/html_node/patch-Options....
chen bin's user avatar
  • 4,877
2 votes
Accepted

How to manual set the specified paragraph to compare in ediff

Type = to invoke ediff-inferior-compare-regions Tell it that you don't want to compare the current highlighted regions, and Ediff will ask you to select the regions that you do want to compare. ...
phils's user avatar
  • 51.7k
2 votes

make ediff jump to closest difference

This is what I do. It almost answers your question. Move the cursor in one of the buffers, say B, to a nearby difference zone (diff). Typically there is one nearby, and syncing there is sufficient. ...
Drew's user avatar
  • 78k
2 votes

Magit diff working file to commit in log?

I can't think of a one-step way to do this. The best I can come up with is Type dr (magit-diff), and set the range to the commit If point is on the commit, you can copy it with C-w before calling ...
Kyle Meyer's user avatar
  • 7,094

Only top scored, non community-wiki answers of a minimum length are eligible