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.
Find
ediff-util.el
(it may beediff-util.el.gz
on your system). Read the functionediff-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.