Function: ediff-merge-buffers-with-ancestor

ediff-merge-buffers-with-ancestor is an autoloaded, interactive and byte-compiled function defined in ediff.el.gz.

Signature

(ediff-merge-buffers-with-ancestor BUFFER-A BUFFER-B BUFFER-ANCESTOR &optional STARTUP-HOOKS JOB-NAME MERGE-BUFFER-FILE)

Documentation

Merge buffers with ancestor.

BUFFER-A and BUFFER-B are the buffers to be merged, and BUFFER-ANCESTOR is their ancestor. STARTUP-HOOKS is a list of functions that Emacs calls without arguments after setting up the Ediff buffers. JOB-NAME is a symbol describing the Ediff job type; it defaults to ediff-merge-buffers-with-ancestor, but can also be one of ediff-merge-files-with-ancestor, ediff-last-dir-ancestor, ediff-last-dir-C, ediff-buffers, ediff-buffers3, or ediff-merge-buffers. MERGE-BUFFER-FILE is the name of the file to be associated with the merge buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff.el.gz
;;;###autoload
(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
						   &optional
						   startup-hooks
						   job-name
						   ;; MERGE-BUFFER-FILE is the
						   ;; file to be associated
						   ;; with the merge buffer
						   merge-buffer-file)
  "Merge buffers with ancestor.
BUFFER-A and BUFFER-B are the buffers to be merged, and
BUFFER-ANCESTOR is their ancestor.  STARTUP-HOOKS is a list of
functions that Emacs calls without arguments after setting up the
Ediff buffers.  JOB-NAME is a symbol describing the Ediff job
type; it defaults to `ediff-merge-buffers-with-ancestor', but can
also be one of `ediff-merge-files-with-ancestor',
`ediff-last-dir-ancestor', `ediff-last-dir-C', `ediff-buffers',
`ediff-buffers3', or `ediff-merge-buffers'.  MERGE-BUFFER-FILE is
the name of the file to be associated with the merge buffer."
  (interactive
   (let (bf bff)
     (list (setq bf (read-buffer "Buffer A to merge: "
				 (ediff-other-buffer "") t))
	   (setq bff (read-buffer "Buffer B to merge: "
				  (progn
				    ;; realign buffers so that two visible
				    ;; bufs will be at the top
				    (save-window-excursion (other-window 1))
				    (ediff-other-buffer bf))
				  t))
	   (read-buffer "Ancestor buffer: "
				  (progn
				    ;; realign buffers so that three visible
				    ;; bufs will be at the top
				    (save-window-excursion (other-window 1))
				    (ediff-other-buffer (list bf bff)))
				  t)
	   )))

  (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
  (or job-name (setq job-name 'ediff-merge-buffers-with-ancestor))
  (ediff-buffers-internal
   buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file))