From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#46876: [PATCH] Find conflict markers in opened buffers as well Date: Tue, 2 Mar 2021 19:23:49 +0300 Message-ID: <20210302162349.709999-1-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40805"; mail-complaints-to="usenet@ciao.gmane.io" To: 46876@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 02 17:25:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH7pf-000AKu-EO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Mar 2021 17:25:11 +0100 Original-Received: from localhost ([::1]:43540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH7pe-00043i-G5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Mar 2021 11:25:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH7pX-00043M-0p for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 11:25:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH7pW-0000zz-Py for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 11:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lH7pW-0004x4-LR for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 11:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Mar 2021 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161470224618968 (code B ref -1); Tue, 02 Mar 2021 16:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Mar 2021 16:24:06 +0000 Original-Received: from localhost ([127.0.0.1]:54061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH7oc-0004vr-6Z for submit@debbugs.gnu.org; Tue, 02 Mar 2021 11:24:06 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH7oY-0004vh-4N for submit@debbugs.gnu.org; Tue, 02 Mar 2021 11:24:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH7oX-0003Ou-UW for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 11:24:01 -0500 Original-Received: from forward100p.mail.yandex.net ([77.88.28.100]:37902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH7oU-0000t7-Nt for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 11:24:01 -0500 Original-Received: from forward102q.mail.yandex.net (forward102q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:516:4e7d]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 097CD59819E0 for ; Tue, 2 Mar 2021 19:23:53 +0300 (MSK) Original-Received: from vla1-eeea27dff809.qloud-c.yandex.net (vla1-eeea27dff809.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:5184:0:640:eeea:27df]) by forward102q.mail.yandex.net (Yandex) with ESMTP id 059633A2000B for ; Tue, 2 Mar 2021 19:23:53 +0300 (MSK) Original-Received: from vla1-cde8305024b9.qloud-c.yandex.net (vla1-cde8305024b9.qloud-c.yandex.net [2a02:6b8:c0d:4201:0:640:cde8:3050]) by vla1-eeea27dff809.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 11YUnCI3a7-NqHGCOuN; Tue, 02 Mar 2021 19:23:52 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1614702233; bh=4gI6ylZnTkUxtvArl9tgHEeVnwDNd2/2yI/mH2l6Qzw=; h=Date:Subject:To:From:Message-Id; b=a/GaQyy6vbT2ebKdQXLd3NytuAdQcj3opemf6dgsGR+ToQlHHz+II0HzOXrncW2NK LK3R4M9H5f/0MvlPKX8EgjjvBO6T5CQWBpDwnWKGhzaUYIKEOj6ur857dZNNws2bxT 0RecIx4io8lJILdMY5i0hhaBo2E4sEk+07GbpRHc= Authentication-Results: vla1-eeea27dff809.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by vla1-cde8305024b9.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 2v75UyJwZa-NqJmJgHo; Tue, 02 Mar 2021 19:23:52 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Mailer: git-send-email 2.30.1 Received-SPF: pass client-ip=77.88.28.100; envelope-from=Hi-Angel@yandex.ru; helo=forward100p.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201225 Archived-At: 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