Subject: [PATCH v2 2/2] smerge-mode: new function to go to next conflict

From: Konstantin Kharlamov <[email-masked]>
Date: Mon, 11 Feb 2019 01:30:13 +0300

* lisp/vc/smerge-mode.el (smerge-vc-next-conflict)
---

v2: added documentation for the function

 lisp/vc/smerge-mode.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 929cd85432a..0bc11fee23c 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1435,6 +1435,20 @@ smerge-start-session
         (smerge-next))
     (error (smerge-auto-leave))))
 
+(require 'vc)
+
+(defun smerge-vc-next-conflict ()
+  "Tries to go to next conflict in current file, otherwise tries
+to open next conflicted file version-control-system wise"
+  (interactive)
+  (let ((buffer (current-buffer)))
+    (when (not (smerge-goto-next-conflict))
+      (vc-find-conflicted-file)
+      (if (eq buffer (current-buffer))
+          (message "No conflicts found")
+        (goto-char 0)
+        (smerge-goto-next-conflict)))))
+
 (provide 'smerge-mode)
 
 ;;; smerge-mode.el ends here
-- 
2.20.1