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#46538: [PATCH] vc: make smerge-vc-next-conflict wrap around Date: Tue, 16 Feb 2021 01:25:04 +0300 Message-ID: <20210215222504.281682-1-Hi-Angel@yandex.ru> References: <87wnv9ta5i.fsf@tcd.ie> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20042"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie To: 46538@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 15 23:27:41 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 1lBmLE-00057R-S6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 23:27:40 +0100 Original-Received: from localhost ([::1]:60444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBmLD-0002KO-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 17:27:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBmJe-0000ja-Vk for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 17:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBmJd-00077x-T4 for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 17:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBmJd-0007XI-QJ for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 17:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Feb 2021 22:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46538 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46538-submit@debbugs.gnu.org id=B46538.161342792228920 (code B ref 46538); Mon, 15 Feb 2021 22:26:01 +0000 Original-Received: (at 46538) by debbugs.gnu.org; 15 Feb 2021 22:25:22 +0000 Original-Received: from localhost ([127.0.0.1]:38884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBmJ0-0007WO-Ir for submit@debbugs.gnu.org; Mon, 15 Feb 2021 17:25:22 -0500 Original-Received: from forward102o.mail.yandex.net ([37.140.190.182]:56766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBmIx-0007W6-53 for 46538@debbugs.gnu.org; Mon, 15 Feb 2021 17:25:21 -0500 Original-Received: from myt6-08ca0b879dee.qloud-c.yandex.net (myt6-08ca0b879dee.qloud-c.yandex.net [IPv6:2a02:6b8:c12:12a2:0:640:8ca:b87]) by forward102o.mail.yandex.net (Yandex) with ESMTP id DA86766817E6; Tue, 16 Feb 2021 01:25:11 +0300 (MSK) Original-Received: from myt4-1dda227af9a8.qloud-c.yandex.net (myt4-1dda227af9a8.qloud-c.yandex.net [2a02:6b8:c00:3c83:0:640:1dda:227a]) by myt6-08ca0b879dee.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 8Zz7hdTE5p-PBHWlrPh; Tue, 16 Feb 2021 01:25:11 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1613427911; bh=2jfLe4OnxzqBqOHEUohVsSjO7O6yTnbxi+J/A3EKf4Y=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=Ew1yRFIsfsk2eLHTtt03Gxvf15GgmsGwChXJmmZ0D5YmhNEY6oO9GqeLVqM9Ga7F+ C1H2mEwiYphP5eaR4+P45cDaT81Wvw2mICTGNOyxO1OC3ZGrkCytyoK0H0F4hiDocF OLNbZKNHt5xF+dvFAevYWC1FWyGKgiVdraI/VTHg= Authentication-Results: myt6-08ca0b879dee.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by myt4-1dda227af9a8.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id qcmaJGowt3-PBKu9amW; Tue, 16 Feb 2021 01:25:11 +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 In-Reply-To: <87wnv9ta5i.fsf@tcd.ie> 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:200090 Archived-At: * lisp/vc/smerge-mode.el: (smerge-vc-next-conflict): While searching for conflict markers, wrap search around if current file is the last one with conflicts. --- lisp/vc/smerge-mode.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 3b09dfe5d2..b825fd9837 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1469,12 +1469,12 @@ smerge-vc-next-conflict (if (and (buffer-modified-p) buffer-file-name) (save-buffer)) (vc-find-conflicted-file) - (if (eq buffer (current-buffer)) - ;; Do nothing: presumably `vc-find-conflicted-file' already - ;; emitted a message explaining there aren't any more conflicts. - nil - (goto-char (point-min)) - (smerge-next))))))) + (when (eq buffer (current-buffer)) + ;; try to find a conflict marker in current file above the point + (let ((prev-pos (point))) + (goto-char (point-min)) + (unless (ignore-errors (not (smerge-next))) + (goto-char prev-pos))))))))) (provide 'smerge-mode) -- 2.30.1