Function: ediff-merge-files

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

Signature

(ediff-merge-files FILE-A FILE-B &optional STARTUP-HOOKS MERGE-BUFFER-FILE)

Documentation

Merge two files without ancestor.

FILE-A and FILE-B are the names of the files to be merged. STARTUP-HOOKS is a list of functions that Emacs calls without arguments after setting up the Ediff buffers. MERGE-BUFFER-FILE is the name of the file to be associated with the merge buffer..

Key Bindings

Aliases

ediff-merge

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff.el.gz
;;;###autoload
(defun ediff-merge-files (file-A file-B
				 ;; MERGE-BUFFER-FILE is the file to be
				 ;; associated with the merge buffer
				 &optional startup-hooks merge-buffer-file)
  "Merge two files without ancestor.
FILE-A and FILE-B are the names of the files to be merged.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers.  MERGE-BUFFER-FILE
is the name of the file to be associated with the merge buffer.."
  (interactive
   (let ((dir-A (if ediff-use-last-dir
		    ediff-last-dir-A
		  default-directory))
	 dir-B f)
     (list (setq f (ediff-read-file-name
		    "File A to merge"
		    dir-A
		    (ediff-get-default-file-name)
		    'no-dirs))
	   (ediff-read-file-name "File B to merge"
				 (setq dir-B
				       (if ediff-use-last-dir
					   ediff-last-dir-B
					 (file-name-directory f)))
				 (progn
				   (add-to-history
				    'file-name-history
				    (ediff-abbreviate-file-name
				     (expand-file-name
				      (file-name-nondirectory f)
				      dir-B)))
				   (ediff-get-default-file-name f 1)))
	   )))
  (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
  (ediff-files-internal file-A
			(if (file-directory-p file-B)
			    (expand-file-name
			     (file-name-nondirectory file-A) file-B)
			  file-B)
			  nil ; file-C
			  startup-hooks
			  'ediff-merge-files
			  merge-buffer-file))