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,gmane.emacs.devel Subject: bug#64063: smerge-mode highlight gets stuck if buffer autoreverted "delicately" Date: Sat, 17 Jun 2023 03:39:20 +0300 Message-ID: <04b76a0d059030e56463fdf5863d2060f79c1c96.camel@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.2 Cc: mardani29@yahoo.es, emacs-devel@gnu.org To: 64063@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 17 02:40:12 2023 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 1qAJzA-0008Yg-Dn for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Jun 2023 02:40:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAJz3-0003Li-Jn; Fri, 16 Jun 2023 20:40:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAJz1-0003Kz-8D for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 20:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAJz0-0004Gw-Ux for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 20:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAJz0-0001dk-QU for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 20:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jun 2023 00:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64063 X-GNU-PR-Package: emacs Original-Received: via spool by 64063-submit@debbugs.gnu.org id=B64063.16869623676202 (code B ref 64063); Sat, 17 Jun 2023 00:40:02 +0000 Original-Received: (at 64063) by debbugs.gnu.org; 17 Jun 2023 00:39:27 +0000 Original-Received: from localhost ([127.0.0.1]:50609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAJyR-0001by-8J for submit@debbugs.gnu.org; Fri, 16 Jun 2023 20:39:27 -0400 Original-Received: from forward500c.mail.yandex.net ([178.154.239.208]:34012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAJyN-0001bf-KE for 64063@debbugs.gnu.org; Fri, 16 Jun 2023 20:39:25 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5311:0:640:eae5:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id 4962E5EF40; Sat, 17 Jun 2023 03:39:21 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id KdRLVVHDW0U0-rZwgkELW; Sat, 17 Jun 2023 03:39:20 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1686962360; bh=hUF9RNjGMi4L/8rO/xjAMlrfMfOFjEDrvrDi8bNLvOY=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=OjTC+rbSLWC2aQoJeSjJaq5alikNa5m2n1kPwa/Ut71e4AHvBIzR2HYaL6ap7ygcy DviSZVqHteGRm39MKLPr1/SA1o2oJ+cM1LPBx3HEzNYMP04RVf5qCi+tCvwcJIh2hj v0qVzScPMC3/TT5ns1xZSuLQxW/Muc3BBFNiEzrU= Authentication-Results: mail-nwsmtp-smtp-production-main-57.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263493 gmane.emacs.devel:306845 Archived-At: On Sat, 2023-06-17 at 03:16 +0300, Konstantin Kharlamov wrote: > On Thu, 2023-06-01 at 13:35 +0200, Daniel Mart=C3=ADn wrote: > > > So, my question is, what "on change" hooks smerge-mode uses to detect= that > > > a > > > change to the buffer has been made to check whether conflict markers = are > > > still > > > in place? I tried searching for the word "hook" over the smerge-mode.= el > > > but > > > didn't find anything relevant. > >=20 > > If font-lock is enabled, smerge-mode uses it to fontify the conflicting > > regions.=C2=A0 See smerge-font-lock-keywords.=C2=A0 So perhaps the regu= lar > > font-lock debugging techniques might help you investigate this issue in > > more detail. >=20 > So, I think the problem is that the highlight that gets stuck does not us= e > font-lock, > or at least not through means of `smerge-font-lock-keywords`. Whatever is > defined in > `smerge-font-lock-keywords` gets unhighlighted correctly. But the part th= at > gets > stuck instead is an overlay. >=20 > So I presume besides font-lock-mode there's some other highlight manageme= nt > ongoing, > the one that decides whether to put/remove overlays over some text. Okay, I think I figured it out. The hook upon which stuff gets highlighted = is `find-file-hook`. It calls vc, vc calls smerge, which checks if there's any conflict markers; then finally `(smerge-refine)` gets called which adds the problematic overlay. I'm not quite sure though what is the correct fix in this case. The problem appears when autorevert-mode is enabled, so one way may be always adding a = hook to `after-revert-hook` that clears up the overlays. But there *may* be some other way. I notice that if I remove a conflict mar= ker manually, this makes the overlay disappear. I don't know what exactly cause= s that to happen, but the answer to this may hide another possibility to fix = the bug. If anybody has the knowledge I will be glad to hear C: