Function: change-log-resolve-conflict
change-log-resolve-conflict is a byte-compiled function defined in
add-log.el.gz.
Signature
(change-log-resolve-conflict)
Documentation
Function to be used in smerge-resolve-function.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/add-log.el.gz
(defun change-log-resolve-conflict ()
"Function to be used in `smerge-resolve-function'."
(save-excursion
(save-restriction
(narrow-to-region (match-beginning 0) (match-end 0))
(let ((mb1 (match-beginning 1))
(me1 (match-end 1))
(mb3 (match-beginning 3))
(me3 (match-end 3))
(tmp1 (generate-new-buffer " *changelog-resolve-1*"))
(tmp2 (generate-new-buffer " *changelog-resolve-2*")))
(unwind-protect
(let ((buf (current-buffer)))
(with-current-buffer tmp1
(change-log-mode)
(insert-buffer-substring buf mb1 me1))
(with-current-buffer tmp2
(change-log-mode)
(insert-buffer-substring buf mb3 me3)
;; Do the merge here instead of inside `buf' so as to be
;; more robust in case change-log-merge fails.
(change-log-merge tmp1))
(goto-char (point-max))
(delete-region (point-min)
(prog1 (point)
(insert-buffer-substring tmp2))))
(kill-buffer tmp1)
(kill-buffer tmp2))))))