From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#46876: [PATCH] Find conflict markers in opened buffers as well Date: Tue, 9 Mar 2021 16:15:02 +0200 Message-ID: References: <20210302162349.709999-1-Hi-Angel@yandex.ru> <20210302194019.714751-1-Hi-Angel@yandex.ru> <969164031c7e35971eaa4dedefd4e5acb2827613.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23312"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 To: Konstantin Kharlamov , 46876-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 09 15:17:45 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 1lJdB9-0005uv-R5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Mar 2021 15:17:43 +0100 Original-Received: from localhost ([::1]:43586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJdB8-0001Ca-RW for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Mar 2021 09:17:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJd9X-0008Tt-1y for bug-gnu-emacs@gnu.org; Tue, 09 Mar 2021 09:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJd9W-00010W-Nh for bug-gnu-emacs@gnu.org; Tue, 09 Mar 2021 09:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lJd9W-0005hy-Hm for bug-gnu-emacs@gnu.org; Tue, 09 Mar 2021 09:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Mar 2021 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46876-done@debbugs.gnu.org id=D46876.161529931321877 (code D ref 46876); Tue, 09 Mar 2021 14:16:02 +0000 Original-Received: (at 46876-done) by debbugs.gnu.org; 9 Mar 2021 14:15:13 +0000 Original-Received: from localhost ([127.0.0.1]:46051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJd8i-0005gn-Rm for submit@debbugs.gnu.org; Tue, 09 Mar 2021 09:15:13 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:44863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJd8g-0005gV-Dk for 46876-done@debbugs.gnu.org; Tue, 09 Mar 2021 09:15:11 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id j4-20020a05600c4104b029010c62bc1e20so6481915wmi.3 for <46876-done@debbugs.gnu.org>; Tue, 09 Mar 2021 06:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=f2mYldDzOPAP1e0qIQ92hYZxg5nqIu/b2JTO+oZGzeY=; b=i/y1/BUYvjA6MLwYcXJQ0pJ4uTp/cdY/bvtr0MqZ2VDsbc5MckOK3gQAB8LXM5Enb3 s8knFrAs49XmlFErzA1AOrWPJWQhUB/I7pUk592S4xX9GDB1DELVD9DLfU36jPuoTFUr 6ylcZkiwrYtlnOXz/hhG9ZfShqzY6RL5egoyN8OQ3VXUU+poLp2CHAww5QVpxDMqGDr1 3i7b6WcFNUKg1k2r20/XKEbIp/xed3MK5stEHNUFQSykbWrzvjXrYk4HLbx204AGsX6t NtDXBd0IBLG3qb/ZmEtaP3eguZa/fupg2freDDN1sQW3ol/RPaRSOrdU+fc/GkmZc21q Ox9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f2mYldDzOPAP1e0qIQ92hYZxg5nqIu/b2JTO+oZGzeY=; b=D1Gu4efT5VLIXfXIXbs3D0GcqinuWjOHmq87NhqcAMoacZKLaS+vDfT06UqZPwOXkq fOXH0W6nvE8qiuk0BSqF8qAfCgdWEJnpuXJ4YktB8IOlEHcwLNCsvbXeBzoyhM3edgEu yN89qQKKCKQa0Wkdkzg16bUP1j/gEZ2mkaY8dqzV0brogrrSboWv37uCRtZu6HOQDv2q TjtfKGBKzkzXbaH8CDtN52TukE+mpv89h6bKiycK23Mi6q77vyvAsRN0WbILpulxXZRv nFQeAmbc+dFnKK2kMpWLzVSJkd1aTNSdnQf6HVdF61kyPdxT9KLjmD94lfpXpW8qaU2Y mEzQ== X-Gm-Message-State: AOAM530mPmtBWnQ3TqO6McwUEluXXw6F/LtaoZfbgP6DWQRkpOZcHPiq QmB89n5nf0j0+NPlX+f04IvDUkQyeQI= X-Google-Smtp-Source: ABdhPJyzy/5gMkSl6oTdbsSwuFMBJ/iYbaieElE2ky9f0TLyReKnedqG6V/SXFoEURVcT+bpfmE/Iw== X-Received: by 2002:a1c:7402:: with SMTP id p2mr4175473wmc.43.1615299304632; Tue, 09 Mar 2021 06:15:04 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p27sm4553336wmi.12.2021.03.09.06.15.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Mar 2021 06:15:03 -0800 (PST) In-Reply-To: <969164031c7e35971eaa4dedefd4e5acb2827613.camel@yandex.ru> Content-Language: en-US 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:201913 Archived-At: On 09.03.2021 08:32, Konstantin Kharlamov wrote: >> This part is suboptimal: >> >>  > When a file is already open in >>  > Emacs, (vc-find-conflicted-file) only switches to that buffer >> >> ...and I had to spend some time figuring out why that happens (hint: >> vc-git-find-file-hook), and that kind of unpredictable behavior is Not >> Good(tm). > > Back when I stumbled upon this behaviour, I didn't research into it because I thought it could be deliberate. The reasoning might have been: if you didn't have a file opened, it doesn't really matter where your point would be once it is. So it shouldn't hurt to just jump to a conflict marker, and so it does. On the other hand, if you did have the file opened, you might not want to lose position of your point (for example, you could have a selection, which you don't want to lose for some reason), IOW initial point position in this case might matter. > > I'm just speculating though, I do not know if it's true, neither I remember having a usecase as the one I imagine it's trying to cover. FWIW, usually when I want to save positions in a buffer, I use (evil-set-marker) from Evil package. I don't use Evil, but set-mark should work. In any case, when the user is calling vc-find-conflicted-file, they probably want to either always go to the conflict markers (whether the file has been visited or not), or never. And "always" probably makes more sense. It's not urgent, though, especially with neither command having a default binding.