[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatic Ediff-session upon opening file conflicted by a version co
From: |
Stefan Monnier |
Subject: |
Re: Automatic Ediff-session upon opening file conflicted by a version control update-conflict |
Date: |
Wed, 14 Nov 2007 10:59:28 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
> How can I make ediff automatically parse the conflicts tags ( <<<<
> File A, >>>> File B, ... ) and enter into an ediff merge-2 or merge-3
> session when I open a file that has been conflicted by an cvs,svn,..
> update. File opening can be either direct or through a svn/cvs/git-
> status buffer.
Normally when you enter a file with diff3 conflict markers you should be
able to automatically activate smerge-mode (a minor mode specifically
designed for that). Ideally, this already works completely
automatically (thanks to VC). If it doesn't, please give us
some details (I know it doesn't always work, but I'm not sure in which
circumstances it fails, so it'll help me fix it).
In case smerge-mode is not automatically activated, you may want to add
something like the following to your .emacs:
(defun sm-try-smerge ()
(save-excursion
(goto-char (point-min))
(when (re-search-forward "^<<<<<<< " nil t)
(smerge-mode 1))))
(when (fboundp 'smerge-mode) (add-hook 'find-file-hooks 'sm-try-smerge t))
Now, once smerge-mode is activated, you can enter ediff with C-c ^ E
Stefan