(defcustom smerge-diff-switches
(append '("-d" "-b")
(if (listp diff-switches) diff-switches (list diff-switches)))
- "*A list of strings specifying switches to be be passed to diff.
+ "*A list of strings specifying switches to be passed to diff.
Used in `smerge-diff-base-mine' and related functions."
:group 'smerge
:type '(repeat string))
"Pop up the Smerge mode context menu under mouse."
(interactive "e")
(if (and smerge-mode
- (save-excursion (mouse-set-point event) (smerge-check 1)))
+ (save-excursion (posn-set-point (event-end event)) (smerge-check 1)))
(progn
- (mouse-set-point event)
+ (posn-set-point (event-end event))
(smerge-match-conflict)
(let ((i (smerge-get-current))
o)
;; Out of range
(popup-menu smerge-mode-menu)
;; Install overlay.
- (setq o (make-overlay (match-beginning i) (match-end i)))
+ (setq o (make-overlay (match-beginning i) (match-end i)))
(unwind-protect
(progn
(overlay-put o 'face 'highlight)
;; handle the various conflict styles
(cond
+ ((save-excursion
+ (goto-char mine-start)
+ (re-search-forward smerge-begin-re end t))
+ ;; 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)
(unwind-protect
(add-text-properties start end smerge-text-properties)
(restore-buffer-modified-p m)))
-
+
(store-match-data (list start end
mine-start mine-end
base-start base-end
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)
(provide 'smerge-mode)
-;;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
+;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690
;;; smerge-mode.el ends here