From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fwd: [PATCH] =?utf-8?Q?Don=E2=80=99t?= run smerge multiple times Date: Wed, 18 Mar 2020 10:20:19 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="14714"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Matthew Bauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 18 15:21:07 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jEZZD-0003i5-8p for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Mar 2020 15:21:07 +0100 Original-Received: from localhost ([::1]:51288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEZZC-0007OS-Ap for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Mar 2020 10:21:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51373) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEZYe-0006u3-MG for emacs-devel@gnu.org; Wed, 18 Mar 2020 10:20:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEZYd-0008HU-DV for emacs-devel@gnu.org; Wed, 18 Mar 2020 10:20:32 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27332) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jEZYd-0008GQ-6Q for emacs-devel@gnu.org; Wed, 18 Mar 2020 10:20:31 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 723481002CF; Wed, 18 Mar 2020 10:20:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3B9AD10024E; Wed, 18 Mar 2020 10:20:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1584541221; bh=c1D9dmRiR7Y59920DcntU0oR/mf0igokYXdoQ63FSxU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Wv64fGSiZdY7MDzIFx4Y0vFbLuiIODvcNJDxqutxoBAGVVoHDVbBBAPDwiZX/kXrh vyFgQY6k5prPQ661FjixIVuJli9HSuJ6QIPGI/8VUNtdmSiCqlB2E15BaUPIQvbhMS Buwz1sRWzUw77+ouxzDBYe0TFxn8w1kg7Fpkj6r29amcv8dr5ub0RWi1f/GfBQ1bt1 KOCWdNHE/+2gEL+3yWgTK+j8yK4vtA8bw/zjqrw7TRqypqwvlE0MD4gmCEbAxTnak6 H3ggfzx5qwNpzR69V451KW9fSXf657TK4+wRtdpEaXS8Pw0CAB1rkvmYP9j7WduRvb w5kU9LDr1uCNA== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DF42F120538; Wed, 18 Mar 2020 10:20:20 -0400 (EDT) In-Reply-To: (Matthew Bauer's message of "Tue, 17 Mar 2020 20:07:25 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245568 Archived-At: Matthew Bauer [2020-03-17 20:07:25] wrote: >> This sounds like a problem in itself. >> Or is it really because the file gets modified multiple times? > I think it is caused by each edit. I see, thanks. > At least the symptom is that after so much idle time, > vc-git-find-file-hook gets run. Now that I'm looking for it, I don't > actually see vc-git-find-file-hook is added to any hooks, so something > seems off. It may be some kind of interaction with Magit that sets > this up. `vc-git-find-file-hook` is run by `vc-refresh-state`: [...] (vc-call-backend backend 'find-file-hook) [...] and `vc-refresh-state` is on `find-file-hook`. This is true regardless of Magit. >>> Related to >>> https://lists.gnu.org/archive/html/emacs-devel/2015-10/msg02201.html > >> That patch was never installed. Has that problem been >> fixed/circumvented some other way? > > It looks like it was fixed in > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21559 in a different way. Good, thanks. I think the original patch's intent was good, tho. I installed the patch below into `master`. Stefan diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 85868b91ec..d0a83fd7c4 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1429,15 +1429,16 @@ smerge-mode (smerge-remove-props (point-min) (point-max)))) ;;;###autoload -(defun smerge-start-session () +(defun smerge-start-session (&optional interactively) "Turn on `smerge-mode' and move point to first conflict marker. If no conflict maker is found, turn off `smerge-mode'." - (interactive) - (smerge-mode 1) - (condition-case nil - (unless (looking-at smerge-begin-re) - (smerge-next)) - (error (smerge-auto-leave)))) + (interactive "p") + (when (or (null smerge-mode) interactively) + (smerge-mode 1) + (condition-case nil + (unless (looking-at smerge-begin-re) + (smerge-next)) + (error (smerge-auto-leave))))) (defcustom smerge-change-buffer-confirm t "If non-nil, request confirmation before moving to another buffer."