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.devel Subject: Re: Tree-sitter api Date: Sat, 18 Dec 2021 18:51:25 -0800 Message-ID: References: <83r1f7hydn.fsf@gnu.org> <83lf3zdh4z.fsf@gnu.org> <8965C4A0-79D3-4D77-A6BA-D07A6C93F7FE@gmail.com> <83ilz3cs4k.fsf@gnu.org> <04D19C1A-CD64-4156-B932-1C9FEEE4EC7B@gmail.com> <83zgsebc0r.fsf@gnu.org> <1F752923-F357-4A18-B6E2-0120F1B9BD37@gmail.com> <83fsu5bzem.fsf@gnu.org> <83zgsdad5j.fsf@gnu.org> <83sfy391ni.fsf@gnu.org> <03386E3C-A975-4ECD-BF89-6AC62F751725@gmail.com> <83ilyz8xdl.fsf@gnu.org> <86czp6ukpj.fsf@stephe-leake.org> <1AEED8A5-BF5E-45E5-AE22-9B405A710F9B@gmail.com> <83czp313tf.fsf@gnu.org> <7447C582-70CB-4599-BC76-AD5687D64250@gmail.com> <784947A6-6164-4158-993B-01E881690ADF@gmail.com> <83zgrxji7q.fsf@gnu.org> <8E8D28F9-258E-490B-BF48-7EF8D6CA0817@gmail.com> <838rzgk6ll.fsf@gnu.org> <83k0g8mznc.fsf@gnu.org> <83tuf69d06.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) 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="5726"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ubolonton@gmail.com, theo@thornhill.no, cpitclaudel@gmail.com, emacs-devel@gnu.org, Philipp , monnier@iro.umontreal.ca, stephen_leake@stephe-leake.org, john@yates-sheets.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 19 03:52:27 2021 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 1mymJH-0001KW-Li for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Dec 2021 03:52:27 +0100 Original-Received: from localhost ([::1]:50158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mymJG-0005kh-Aa for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 21:52:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mymIN-00054p-0j for emacs-devel@gnu.org; Sat, 18 Dec 2021 21:51:31 -0500 Original-Received: from [2607:f8b0:4864:20::230] (port=39595 helo=mail-oi1-x230.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mymIL-000828-KN; Sat, 18 Dec 2021 21:51:30 -0500 Original-Received: by mail-oi1-x230.google.com with SMTP id bf8so10095768oib.6; Sat, 18 Dec 2021 18:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DrwvYy91nYmd3sYzMEMv/SCZi51Vz8Y43dP9Q+CZIDE=; b=MKK+6sMiga5s5CN3O3gOvL6QtgZjeZ1b9RKvT1iI4vgvwlCjVFgA/w6P7JHCKFp57w gt5a7gaO7xBy2FeuKHYbJv11RB48m1jrCKQHeAftbGZ9DejDQXAWmres935sAMCQxX+a mOdWWFJDEpt5wleaHTvSIEo9WJCW3k2x09GheabY/ICT5dmFk5HoZNsj+3aKWWEN9LOW lVtgqsRIc5l+SuptpRDw5YF8wGfGVnZlWgFJ564Q1EFCsSAhRaim/y6r/SYtBbeexrBy iCOa+Usw1KkGraS9DbmKQ4eNF3Ny65SMMvJeOCGOMI439nkX6mF+CNfNXeP6PA56iVCx gzIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DrwvYy91nYmd3sYzMEMv/SCZi51Vz8Y43dP9Q+CZIDE=; b=pIn4+bmVbiIBm1qigD8GX3ifSsqZ/EopMPKlfCHEhMf160ujLA823iKpuhjDzwiyLT rWQOwkXrWKcmA6bK3iudKYj1u0omgF4tmkc7Yng0zfx+Z3fN4ReoSTncRRu8lB42gHRW 2M9zcRcks5kpAyYogUNj9ljXgWefwhgsDrmZvmoKcAS9T5MArVaTo+v2aheywcW0if/m L2kc4vl/T4p0UJhTOvf3f6jw1TSFyX/BxOkV25nhU4C5dKoFrHP5/nXpzu5EcxUFuzsA OZNvm/nUHnSo9QJ3AZ4Bbj37SJETIjRnvx0L2wCnpBJLdHmHy02nHbRgiMxQlqSUCnO5 0mJg== X-Gm-Message-State: AOAM533wqH2WGgkD1X6V1XlnE1EGQFIHJYplDTE06m9Ak7Apg+kTTC47 qYaTJf+pMhWnLhmusLi87Zme6q+6feQutQ== X-Google-Smtp-Source: ABdhPJwPokUKx1nt9ZJhwJjIV8WyQMQd/KAoAtaQLqlNloOdAyMDMW+uG5lVyxUUZdwWcRn9QpIXJQ== X-Received: by 2002:aca:aac6:: with SMTP id t189mr7322351oie.97.1639882288195; Sat, 18 Dec 2021 18:51:28 -0800 (PST) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:ad6a:ccd:800a:f7e5]) by smtp.gmail.com with ESMTPSA id q65sm2021291oih.45.2021.12.18.18.51.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Dec 2021 18:51:27 -0800 (PST) In-Reply-To: <83tuf69d06.fsf@gnu.org> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::230 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=casouri@gmail.com; helo=mail-oi1-x230.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:282356 Archived-At: >>=20 >>> Would you please ping the authors and tell them that this single = issue >>> prevents us from integrating TS into Emacs? Maybe that would change >>> their priorities. I cannot imagine that the feature we are asking = is >>> hard to implement. >>=20 >> That feature in itself won't be enough. Even with it, TreeSitter = will have the same problem as GMP: allocation isn't allowed to fail, and = longjmp'ing out of it isn't allowed and generally causes undefined = behavior. >=20 > It may not be enough to satisfy purists, but it's enough to allow the > user to save the session and shut down Emacs in an orderly fashion, > instead of abruptly exiting and losing all the edits. Uses can set tree-sitter-maximum-size to limit memory usage of = tree-sitter. Buffers with size larger than that cannot enable = tree-sitter. That doesn=E2=80=99t solve the problem directly but should = let users avoid allocation failing most of the time. Yuan=