summaryrefslogtreecommitdiff
path: root/lisp/smerge-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-04-15 20:19:11 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-04-15 20:19:11 +0000
commit9f0c286d22c49f88af21e00532e2fd232f748c99 (patch)
treed82f12fdbad25df261830cba35922fd4a9eb5ba8 /lisp/smerge-mode.el
parentadbb5567a81761c6625031c743e812cda1cdc8b6 (diff)
downloademacs-9f0c286d22c49f88af21e00532e2fd232f748c99.tar.gz
(smerge-match-conflict): Try to do something sensible
for nested conflict markers. (smerge-find-conflict): Better handle errors in smerge-match-conflict.
Diffstat (limited to 'lisp/smerge-mode.el')
-rw-r--r--lisp/smerge-mode.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index bd4d8d04a6f..80547821343 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -477,6 +477,13 @@ An error is raised if not inside a conflict."
;; handle the various conflict styles
(cond
+ ((save-excursion
+ (goto-char mine-start)
+ (re-search-forward smerge-begin-re nil end))
+ ;; There's a nested conflict and we're after the the beginning
+ ;; of the outer one but before the beginning of the inner one.
+ (error "There is a nested conflict"))
+
((re-search-backward smerge-base-re start t)
;; a 3-parts conflict
(set (make-local-variable 'smerge-conflict-style) 'diff3-A)
@@ -521,9 +528,11 @@ The submatches are the same as in `smerge-match-conflict'.
Returns non-nil if a match is found between the point and LIMIT.
The point is moved to the end of the conflict."
(when (re-search-forward smerge-begin-re limit t)
- (ignore-errors
- (smerge-match-conflict)
- (goto-char (match-end 0)))))
+ (condition-case err
+ (progn
+ (smerge-match-conflict)
+ (goto-char (match-end 0)))
+ (error (smerge-find-conflict limit)))))
(defun smerge-diff (n1 n2)
(smerge-match-conflict)
@@ -673,5 +682,5 @@ buffer names."
(provide 'smerge-mode)
-;;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
+;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
;;; smerge-mode.el ends here