Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
30e68410
Commit
30e68410
authored
Jan 15, 2008
by
Stefan Monnier
Browse files
(smerge-refine): Also work on "same change conflicts".
(smerge-makeup-conflict): New command.
parent
2507310c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/smerge-mode.el
lisp/smerge-mode.el
+32
-4
No files found.
lisp/ChangeLog
View file @
30e68410
2008-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
* smerge-mode.el (smerge-refine): Also work on "same change conflicts".
(smerge-makeup-conflict): New command.
2008-01-15 Thien-Thi Nguyen <ttn@gnuvola.org>
* log-edit.el (log-edit): Doc fix.
...
...
lisp/smerge-mode.el
View file @
30e68410
...
...
@@ -851,10 +851,12 @@ replace chars to try and eliminate some spurious differences."
(
remove-overlays
(
match-beginning
0
)
(
match-end
0
)
'smerge
'refine
)
(
smerge-ensure-match
1
)
(
smerge-ensure-match
3
)
(
smerge-refine-subst
(
match-beginning
1
)
(
match-end
1
)
(
match-beginning
3
)
(
match-end
3
)
'
((
smerge
.
refine
)
(
face
.
smerge-refined-change
))))
;; Match 1 and 3 may be one and the same in case of trivial diff3 -A conflict.
(
let
((
n1
(
if
(
eq
(
match-end
1
)
(
match-end
3
))
2
1
)))
(
smerge-refine-subst
(
match-beginning
n1
)
(
match-end
n1
)
(
match-beginning
3
)
(
match-end
3
)
'
((
smerge
.
refine
)
(
face
.
smerge-refined-change
)))))
(
defun
smerge-diff
(
n1
n2
)
(
smerge-match-conflict
)
...
...
@@ -992,6 +994,32 @@ buffer names."
(
message
"Conflict resolution finished; you may save the buffer"
)))))
(
message
"Please resolve conflicts now; exit ediff when done"
)))
(
defun
smerge-makeup-conflict
(
pt1
pt2
pt3
&optional
pt4
)
"Insert diff3 markers to make a new conflict.
Uses point and mark for 2 of the relevant positions and previous marks
for the other ones.
By default, makes up a 2-way conflict,
with a \\[universal-argument] prefix, makes up a 3-way conflict."
(
interactive
(
list
(
point
)
(
mark
)
(
progn
(
pop-mark
)
(
mark
))
(
when
current-prefix-arg
(
pop-mark
)
(
mark
))))
;; Start from the end so as to avoid problems with pos-changes.
(
destructuring-bind
(
pt1
pt2
pt3
&optional
pt4
)
(
sort
(
list*
pt1
pt2
pt3
(
if
pt4
(
list
pt4
)))
'>=
)
(
goto-char
pt1
)
(
beginning-of-line
)
(
insert
">>>>>>> OTHER\n"
)
(
goto-char
pt2
)
(
beginning-of-line
)
(
insert
"=======\n"
)
(
goto-char
pt3
)
(
beginning-of-line
)
(
when
pt4
(
insert
"||||||| BASE\n"
)
(
goto-char
pt4
)
(
beginning-of-line
))
(
insert
"<<<<<<< MINE\n"
))
(
if
smerge-mode
nil
(
smerge-mode
1
))
(
smerge-refine
))
(
defconst
smerge-parsep-re
(
concat
smerge-begin-re
"\\|"
smerge-end-re
"\\|"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment