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
74dea9e1
Commit
74dea9e1
authored
Jul 20, 2007
by
Stefan Monnier
Browse files
(change-log-resolve-conflict): Don't lose data if the merge fails.
parent
bb042dc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
11 deletions
+31
-11
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/add-log.el
lisp/add-log.el
+26
-11
No files found.
lisp/ChangeLog
View file @
74dea9e1
2007-07-20 Stefan Monnier <monnier@iro.umontreal.ca>
* add-log.el (change-log-resolve-conflict): Don't lose data if the
merge fails.
2007-07-20 Dan Nicolaescu <dann@ics.uci.edu>
* progmodes/compile.el (compilation-auto-jump-to-first-error):
...
...
lisp/add-log.el
View file @
74dea9e1
...
...
@@ -1043,17 +1043,32 @@ Point is assumed to be at the start of the entry."
(
defun
change-log-resolve-conflict
()
"Function to be used in `smerge-resolve-function'."
(
let
((
buf
(
current-buffer
)))
(
with-temp-buffer
(
insert-buffer-substring
buf
(
match-beginning
1
)
(
match-end
1
))
(
save-match-data
(
change-log-mode
))
(
let
((
other-buf
(
current-buffer
)))
(
with-current-buffer
buf
(
save-excursion
(
save-restriction
(
narrow-to-region
(
match-beginning
0
)
(
match-end
0
))
(
replace-match
(
match-string
3
)
t
t
)
(
change-log-merge
other-buf
))))))))
(
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
))))))
;;;###autoload
(
defun
change-log-merge
(
other-log
)
...
...
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