changeset 54903:922f49230ff5

(smerge-match-conflict): Try to do something sensible for nested conflict markers. (smerge-find-conflict): Better handle errors in smerge-match-conflict.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 15 Apr 2004 20:19:11 +0000
parents 0895b563f562
children a23bbf466906
files lisp/smerge-mode.el
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/smerge-mode.el	Thu Apr 15 20:04:38 2004 +0000
+++ b/lisp/smerge-mode.el	Thu Apr 15 20:19:11 2004 +0000
@@ -477,6 +477,13 @@
 
 	  ;; 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 @@
 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 @@
 
 (provide 'smerge-mode)
 
-;;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
+;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
 ;;; smerge-mode.el ends here