From: Stefan Monnier Date: Thu, 15 Apr 2004 20:19:11 +0000 (+0000) Subject: (smerge-match-conflict): Try to do something sensible X-Git-Tag: ttn-vms-21-2-B4~6806 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f0c286d22c49f88af21e00532e2fd232f748c99;p=emacs.git (smerge-match-conflict): Try to do something sensible for nested conflict markers. (smerge-find-conflict): Better handle errors in smerge-match-conflict. --- 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