From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#66431: [PATCH] Fix reset treesit--explorer-last-node when explorer buffer was killed Date: Sat, 21 Oct 2023 11:33:20 -0700 Message-ID: References: <83a5slsjmh.fsf@gnu.org> <76FD5982-60CC-48D2-9823-C235CCEC2EEC@gmail.com> <029D1797-AE78-4E45-BE25-0BEC8AF47321@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="36354"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 66431@debbugs.gnu.org To: nvp Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 20:34:49 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 1quGoD-0009Jw-Fx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 20:34:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quGo0-0000Vl-SG; Sat, 21 Oct 2023 14:34:36 -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 1quGny-0000V2-Sl for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:34:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quGny-00065Q-KH for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:34:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quGoQ-0007e8-EX for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 14:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 18:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66431 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66431-submit@debbugs.gnu.org id=B66431.169791324829310 (code B ref 66431); Sat, 21 Oct 2023 18:35:02 +0000 Original-Received: (at 66431) by debbugs.gnu.org; 21 Oct 2023 18:34:08 +0000 Original-Received: from localhost ([127.0.0.1]:45027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGnY-0007cg-CX for submit@debbugs.gnu.org; Sat, 21 Oct 2023 14:34:08 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:53287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quGnV-0007c6-Gw for 66431@debbugs.gnu.org; Sat, 21 Oct 2023 14:34:06 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso1626492b3a.2 for <66431@debbugs.gnu.org>; Sat, 21 Oct 2023 11:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697913212; x=1698518012; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+v9EASCdl7arNr3HZsRwkU97GmEElcdNamNMi+gPzSU=; b=fVzTJcpkuym2vFzxvYEBHfewyQreb89wD04DeOT6LkXXk+DVAEQgpithDBVyuN5bmv OcK8rdfJ3rtVF5dQv+1livuwbIst9yc3P6M/xLh6jiKLQQ4GqHOwkR8WkFM0RWCNx29X bnBvlFldjXWDm4S+PyHUC20ehCOy3SdNNrqirmZBFX4/TLegv5ZU47N24d6DI86NdRcu EQCRl1OjAIVwGwGF6TdoXTLBizkNKzSkkb8im1M6nC6o3AXj20o4za6Ex3gIcouE16OL wO4B7hoA29EhMp/tmjGP6tRrhcxHutow+Bo6b2aixUjHnPYRLidRt0IQDrvKJ54OfPuU ML7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697913212; x=1698518012; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+v9EASCdl7arNr3HZsRwkU97GmEElcdNamNMi+gPzSU=; b=hS9SiU36nNE1HUcQtQSAGIqNdmReuXDGFYz06TUOYqLo95fUUV+rN6zQI/Jie1jiYV hu9/XJ4mTrhJeltT4UJpfnCwVRg0f4JiNTwVa65y1nw3gkGgbSc9fZ07Lc+GxXzXVGZ4 GiTKJbw9fGONIP9NIY0MPIDEuyucuIkInw3kiRo4XKsRowyghHdOGPf9T20yBG/oxXzF /02o3MxzPt/gB5nzPatd4VrY3Sln5fDHmrdRxlKrUznJfkeTdBkDtvfh22NPICxAU6jB 1TvXrMGELnmOOn4pCeEARV4P6tyxWg208jxqWutflBdeMKbdsN6BmfE4AFsgehXpw0Od U/RA== X-Gm-Message-State: AOJu0Ywk60S5A5fjETt7cb1ABXDRT2BLE/1AL4IxqLgmUn0UfrKPUMB7 N/tPju4noDdd24RYjyWbraXmSt9rJI8= X-Google-Smtp-Source: AGHT+IHWf3MlmEyKudY+uT+OEFFFT5qACVYJvVSn/ZOfLtinwDiLWjGIVE8MifknhaS9PUgAaUN8aA== X-Received: by 2002:aa7:88d0:0:b0:68e:41e9:10be with SMTP id k16-20020aa788d0000000b0068e41e910bemr4329361pff.20.1697913211792; Sat, 21 Oct 2023 11:33:31 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c15-20020aa7952f000000b0068fe7e07190sm3535556pfp.3.2023.10.21.11.33.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Oct 2023 11:33:31 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) 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:272927 Archived-At: > On Oct 20, 2023, at 2:22 PM, nvp wrote: >=20 > That fixes the problem! >=20 > However, the reason I initially put the reset inside the `(unless = (buffer-live-p treesit--explorer-buffer) ...)` > in `treesit-explore-mode` was b/c it looked like there was an = optimization happening in=20 > `treesit--explorer-refresh` where it does this check=20 >=20 > ;; If we didn't edit the buffer nor change the top-level > ;; node, don't redraw the whole syntax tree. > (highlight-only (treesit-node-eq > top-level treesit--explorer-last-node)) >=20 > I don't know if that is something you'd want to keep, but just = pointing it out in case. I think > the initial patch works as well, but still allows that check to work = when the explorer buffer hasn't=20 > been killed. Oh that=E2=80=99s fine, treesit-explore-mode always wipes everything and = start from a clean slate. That optimization is for when the user moves = point in the source buffer when explore-mode is on. If you=E2=80=99d = like to send a patch that does roughly what I did in the patch I sent, = I=E2=80=99d love to merge it. Otherwise I can fix it myself, too. The initial patch could be a bit confusing to the readers since it sets = last-node twice, and it=E2=80=99s not clear why. Thanks, Yuan=