How can I kill-ring-save one region's buffer with ediff?

130 Views Asked by At

I am doing an ediff in emacs and I want to copy the region in one of the buffers in order to paste it into a third buffer. Obviously I can do this manually, but I'd like to be able to do it with a few keystrokes similar to how a and b can be used to replace one buffer's version with the other.

Is there a way to do this already?

If not, how should I go about implementing it? I haven't done a lot of emacs programming before.

1

There are 1 best solutions below

0
On

Find ediff-util.el (it may be ediff-util.el.gz on your system). Read the function ediff-copy-diff. You want to mimic this behavior. Then you can add your new function to the ediff-mode keymap like this (define-key ediff-mode-map "a" 'ediff-copy-A-to-C).

Your function should probably be marked (interactive) and ask for a buffer name. See Emacs interactive codes for details.