# HG changeset patch # User Stefan Monnier # Date 1082060351 0 # Node ID 922f49230ff54652a3990a693de37c024c42c913 # Parent 0895b563f562963bbdaa214c5990e98ea351d17b (smerge-match-conflict): Try to do something sensible for nested conflict markers. (smerge-find-conflict): Better handle errors in smerge-match-conflict. diff -r 0895b563f562 -r 922f49230ff5 lisp/smerge-mode.el --- 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