comparison lisp/smerge-mode.el @ 83099:9cb7ecf775c9

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-219 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-139
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 16 Apr 2004 13:36:07 +0000
parents 0643dc72a250 a23bbf466906
children 6ae3d2810507
comparison
equal deleted inserted replaced
83098:0643dc72a250 83099:9cb7ecf775c9
475 475
476 base-start base-end) 476 base-start base-end)
477 477
478 ;; handle the various conflict styles 478 ;; handle the various conflict styles
479 (cond 479 (cond
480 ((save-excursion
481 (goto-char mine-start)
482 (re-search-forward smerge-begin-re end t))
483 ;; There's a nested conflict and we're after the the beginning
484 ;; of the outer one but before the beginning of the inner one.
485 (error "There is a nested conflict"))
486
480 ((re-search-backward smerge-base-re start t) 487 ((re-search-backward smerge-base-re start t)
481 ;; a 3-parts conflict 488 ;; a 3-parts conflict
482 (set (make-local-variable 'smerge-conflict-style) 'diff3-A) 489 (set (make-local-variable 'smerge-conflict-style) 'diff3-A)
483 (setq base-end mine-end) 490 (setq base-end mine-end)
484 (setq mine-end (match-beginning 0)) 491 (setq mine-end (match-beginning 0))
519 "Find and match a conflict region. Intended as a font-lock MATCHER. 526 "Find and match a conflict region. Intended as a font-lock MATCHER.
520 The submatches are the same as in `smerge-match-conflict'. 527 The submatches are the same as in `smerge-match-conflict'.
521 Returns non-nil if a match is found between the point and LIMIT. 528 Returns non-nil if a match is found between the point and LIMIT.
522 The point is moved to the end of the conflict." 529 The point is moved to the end of the conflict."
523 (when (re-search-forward smerge-begin-re limit t) 530 (when (re-search-forward smerge-begin-re limit t)
524 (ignore-errors 531 (condition-case err
525 (smerge-match-conflict) 532 (progn
526 (goto-char (match-end 0))))) 533 (smerge-match-conflict)
534 (goto-char (match-end 0)))
535 (error (smerge-find-conflict limit)))))
527 536
528 (defun smerge-diff (n1 n2) 537 (defun smerge-diff (n1 n2)
529 (smerge-match-conflict) 538 (smerge-match-conflict)
530 (smerge-ensure-match n1) 539 (smerge-ensure-match n1)
531 (smerge-ensure-match n2) 540 (smerge-ensure-match n2)
671 (font-lock-fontify-region (match-beginning 0) (match-end 0) nil)))))) 680 (font-lock-fontify-region (match-beginning 0) (match-end 0) nil))))))
672 681
673 682
674 (provide 'smerge-mode) 683 (provide 'smerge-mode)
675 684
676 ;;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690 685 ;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
677 ;;; smerge-mode.el ends here 686 ;;; smerge-mode.el ends here