GNU bug report logs - #46876
[PATCH] Find conflict markers in opened buffers as well

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Tue, 2 Mar 2021 16:25:02 UTC

Severity: normal

Tags: patch

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Find conflict markers in opened buffers as well
Date: Tue,  2 Mar 2021 19:23:49 +0300
Call to (vc-find-conflicted-file) will only result in jump to a conflict
marker when file is a newly opened one. When a file is already open in
Emacs, (vc-find-conflicted-file) only switches to that buffer, so we
need to explicitly jump to a conflict marker.

* lisp/vc/smerge-mode.el (smerge-vc-next-conflict): Search for a
conflict marker if call to (vc-find-conflicted-file) haven't resulted in
a jump to one.
---
 lisp/vc/smerge-mode.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 782c799273..383f8435f5 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1468,8 +1468,10 @@ smerge-vc-next-conflict
          (if (and (buffer-modified-p) buffer-file-name)
              (save-buffer))
          (vc-find-conflicted-file)
-         (when (eq buffer (current-buffer))
-           ;; Try to find a conflict marker in current file above the point.
+         ;; At this point, the caret will only be at a conflict marker
+         ;; if the file did not correspond to an opened
+         ;; buffer. Otherwise, we need to jump to a marker explicitly.
+         (unless (looking-at "^<<<<<<<")
            (let ((prev-pos (point)))
              (goto-char (point-min))
              (unless (ignore-errors (not (smerge-next)))
-- 
2.30.1





This bug report was last modified 4 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.