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#59693: 29.0.50; treesitter in base buffer doesn't respond to modifications in indirect buffer correctly Date: Wed, 30 Nov 2022 02:17:14 -0800 Message-ID: <5F7AE71F-0327-409E-BCE9-310E1980C17A@gmail.com> References: <87r0xlbjg6.fsf@miha-pc> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="29999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59693@debbugs.gnu.org To: miha@kamnitnik.top Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 30 11:18:14 2022 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 1p0KAQ-0007Y2-Ce for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Nov 2022 11:18:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0KAH-0001QQ-EY; Wed, 30 Nov 2022 05:18:05 -0500 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 1p0KAE-0001OC-PB for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 05:18:03 -0500 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 1p0KAE-0000c6-Dm for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 05:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0KAE-0006yg-8w for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 05:18:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r0xlbjg6.fsf@miha-pc> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2022 10:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59693 X-GNU-PR-Package: emacs Original-Received: via spool by 59693-submit@debbugs.gnu.org id=B59693.166980344326811 (code B ref 59693); Wed, 30 Nov 2022 10:18:02 +0000 Original-Received: (at 59693) by debbugs.gnu.org; 30 Nov 2022 10:17:23 +0000 Original-Received: from localhost ([127.0.0.1]:60030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0K9b-0006yN-5N for submit@debbugs.gnu.org; Wed, 30 Nov 2022 05:17:23 -0500 Original-Received: from mail-pf1-f171.google.com ([209.85.210.171]:42860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0K9Z-0006yA-Gh for 59693@debbugs.gnu.org; Wed, 30 Nov 2022 05:17:21 -0500 Original-Received: by mail-pf1-f171.google.com with SMTP id h28so2806675pfq.9 for <59693@debbugs.gnu.org>; Wed, 30 Nov 2022 02:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=wols9GYvjglNC34nNLKJt70imeV2QNrH/+hhiE9bq0k=; b=n+sUm/BTW6GsU1e58QvuAjpRU0LhZ4+1G3nCl14VZa34SxqlmZAxYZxZJzNmAmrZfu vkh6VYucDQzq28S6zs1eywDYfZYNYtawaB+cmVLENHnslc/bs/jk3sKbbDS46iF/Gv7e SK9WQ0mdBeCG7YvkeppZxrl0WvGLMBHHl0rS/vvl+Z6JD3uoTObkFUGuOVcTUqZ9Ogi2 aNhqmRhEVw8a0YL/jT/h+sF6jUWuVQdbdLRxms0N34/NfVF2r56vM2X3TGXJgfS5klDw mTSverdJjRolIk6FAp7U/SuedGlxvG7HTbREkcQAzSgsm+mOZdDgzbY6lRRo5bPG/R+L FlIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wols9GYvjglNC34nNLKJt70imeV2QNrH/+hhiE9bq0k=; b=HWgHAAAeZYzfRYyGoqQVka2PI78d7GDsxwS5uikz/Jq9GSW0drxMGlOXo5d5drc3Fq o2sDKEa0ny6cgh3o/DO6y1yWZVSD6zeIlwkWeoJX64PATxhUYkTcFABHKavwL3dKdT8U bcVFVk4D3itPSsBNCc3nCRF/QWHtPpk++5zXJ4XDvUSHOkyrTBwbBDMgvhpnn3SeaOGX TfLSbgieHv/RZ8XasO0MilhYtsYZO0dN9HDG3/9Dwcy8fyr3qjml769rU/tUfnwYVvgI LEIYX6GJ4fcKmWn1+0tnatBRI6XalXuZLGRha7MaL4ANFWri1D1yZguYNgnNXWb/Oo2c IFlA== X-Gm-Message-State: ANoB5pmvVARcavX2wjsLDQZohAsn0TUID5i0gtdjKS1SmLAn2xFzY3d8 Y/tt94cy9Ttqat3WWie0NhsAGaXTD6U= X-Google-Smtp-Source: AA0mqf6siZ9vNOnRcQL5CW8OWhlnnxYrMdgOy6wXSSZwSyg3bd3C2CK/RAap46WF44cbxBgmRltdWg== X-Received: by 2002:a63:f850:0:b0:477:f9fa:80cb with SMTP id v16-20020a63f850000000b00477f9fa80cbmr18538357pgj.118.1669803435780; Wed, 30 Nov 2022 02:17:15 -0800 (PST) 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 pa3-20020a17090b264300b0021870b2c7absm908697pjb.42.2022.11.30.02.17.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2022 02:17:15 -0800 (PST) X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:249476 Archived-At: miha@kamnitnik.top writes: > *** Welcome to IELM *** Type (describe-mode) or press C-h m for = help. > ELISP> (set-buffer (get-buffer-create "a")) > ELISP> (insert "int main();") > ELISP> (require 'treesit) > ELISP> (treesit-node-children (treesit-node-child = (treesit-buffer-root-node 'c) 0)) > (# (primitive_type) > in 1-4> # (function_declarator) > in 5-11> #) > > This is expected > > ELISP> (set-buffer (make-indirect-buffer "a" "b")) > ELISP> (goto-char (point-min)) > ELISP> (insert " ") > ELISP> (set-buffer "a") > ELISP> (buffer-string) > " int main();" > > ELISP> (treesit-node-children (treesit-node-child = (treesit-buffer-root-node 'c) 0)) > (# (primitive_type) > in 1-4> # (function_declarator) > in 5-11> # (ERROR) > in 11-12> #) > > This is unexpected. If we had called '(insert " ")' in the base buffer > "a", we would have got > > (# (primitive_type) > in 2-5> # (function_declarator) > in 6-12> #) > > Thanks for your hard work. Thanks! I forgot about indirect buffers... We=E2=80=99ll need to make = sure to use the parsers in the original buffer when user edits the indirect buffer, or something like that. I need to look into how does indirect buffer works. Yuan