332 |
(when base-start (1- base-start)) base-start |
(when base-start (1- base-start)) base-start |
333 |
(1- other-start) other-start)) |
(1- other-start) other-start)) |
334 |
t) |
t) |
335 |
(error "Point not in conflict region")))) |
(search-failed (error "Point not in conflict region"))))) |
336 |
|
|
337 |
(defun smerge-find-conflict (&optional limit) |
(defun smerge-find-conflict (&optional limit) |
338 |
"Find and match a conflict region. Intended as a font-lock MATCHER. |
"Find and match a conflict region. Intended as a font-lock MATCHER. |
350 |
(smerge-ensure-match n2) |
(smerge-ensure-match n2) |
351 |
(let ((name1 (aref smerge-match-names n1)) |
(let ((name1 (aref smerge-match-names n1)) |
352 |
(name2 (aref smerge-match-names n2)) |
(name2 (aref smerge-match-names n2)) |
353 |
|
;; Read them before the match-data gets clobbered. |
354 |
|
(beg1 (match-beginning n1)) |
355 |
|
(end1 (match-end n1)) |
356 |
|
(beg2 (match-beginning n2)) |
357 |
|
(end2 (match-end n2)) |
358 |
(file1 (make-temp-file "smerge1")) |
(file1 (make-temp-file "smerge1")) |
359 |
(file2 (make-temp-file "smerge2")) |
(file2 (make-temp-file "smerge2")) |
360 |
(dir default-directory) |
(dir default-directory) |
361 |
(file (file-relative-name buffer-file-name))) |
(file (file-relative-name buffer-file-name)) |
362 |
(write-region (match-beginning n1) (match-end n1) file1) |
(coding-system-for-read buffer-file-coding-system)) |
363 |
(write-region (match-beginning n2) (match-end n2) file2) |
(write-region beg1 end1 file1) |
364 |
|
(write-region beg2 end2 file2) |
365 |
(unwind-protect |
(unwind-protect |
366 |
(with-current-buffer (get-buffer-create smerge-diff-buffer-name) |
(with-current-buffer (get-buffer-create smerge-diff-buffer-name) |
367 |
(setq default-directory dir) |
(setq default-directory dir) |