Skip to main content
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
  • 53.1k
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,294
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
8 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
  • 191
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
  • 430
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
  • 79.1k
4 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
  • 271
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.7k
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
  • 53.1k
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
  • 53.1k
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.7k
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
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

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

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
  • 53.1k
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
  • 33.6k
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

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
  • 79.1k
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,174
2 votes

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

Emacs comes with comprehensive documentation in the form of GNU Info pages. To access these press C-h i which will take you to the toplevel menu of major topics which ought to include Emacs, the ...
stevoooo's user avatar
  • 757
2 votes
Accepted

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

I don't use Ediff myself, but I believe to remember that it has such a feature but that it depends on the caller feeding it the necessary information up front. Magit doesn't do that. Please open a ...
tarsius's user avatar
  • 26.3k
2 votes
Accepted

Ediff: compare two files Word-by-word

You can copy the following Elisp snippet into your init file. Disclaimer: The code comes without any guaranty. It references internal functions of ediff. So use it with caution. The newly defined ...
Tobias's user avatar
  • 33.7k
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 do I do the key strokes `C-M-c` in spacemacs?

When you're using ESC for Meta, you want to type it separately, as a prefix. So on most keyboards you could use either: ESCCtrl + c Ctrl + Alt + c
phils's user avatar
  • 53.1k
2 votes
Accepted

Setting mode-line font size and Magit diff colours

In Emacs the appearance of certain text is controlled using something called "faces". You should learn about faces and how to change them by reading the documentation. To quickly change how something ...
tarsius's user avatar
  • 26.3k

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