From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Thu, 2 Apr 2020 12:21:49 +0700 Message-ID: References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> <86wo6yhj4d.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="100809"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 07:22:43 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 1jJsJO-000Q8F-J3 for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 07:22:42 +0200 Original-Received: from localhost ([::1]:33518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJsJN-0000rr-IQ for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 01:22:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37864) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJsIr-0000Mj-9J for emacs-devel@gnu.org; Thu, 02 Apr 2020 01:22:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJsIq-00038H-1e for emacs-devel@gnu.org; Thu, 02 Apr 2020 01:22:09 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:39127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJsIp-000322-QA for emacs-devel@gnu.org; Thu, 02 Apr 2020 01:22:07 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id z3so1057016pjr.4 for ; Wed, 01 Apr 2020 22:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RSqfhP2+qDjoyJMJ7u93AKKqSBMHfwBpLmuZiRcP3jc=; b=q9IBSTiVk2wwORapeqKwNjwfw2s76HuYDsNkwVsDmHZf0EqrvHWodr6rb2U3sjh1gX bjK5gZrDgtsmqGa1W15TJ7iAMMYeELs76vF/J/fKTHp96EAVCozaFgQ9f3krT4W9TigU iNpIZrUEJ6dq+1JMsK3gyPKuRx0wmmRB0T1CpeorlrSxkNEkqwjtJ87MpTHwpi3fxV9H 2hoRc5GEVKi1lAZ4Srd+u+3yn+a+ozl17OsmCZYAFBTmZhIUKNBeEYpGs304lO7SxmNo rih/luyf0g9MCH3xzHm3bjWTccc6XOVmL8J7PRAAjd29ubZhsxYtUnx7v2CufEG7DH9+ yXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RSqfhP2+qDjoyJMJ7u93AKKqSBMHfwBpLmuZiRcP3jc=; b=po5iIvEdgNgB6rcPX+3ESheY/tQOxack2lTtb7eSVkEtzVT4UOUjfPh7oMeY19Zo47 hxHGodKaK77jSlllynMyoxwPJziJujVZwX5A+1Espx+sbQdPfzf0pdybS2TFQIjqraz9 GT+h4Trv7oX5ateZdzUbHILZs3rUWe6uCGa8uHxMezHi8SN77u2BCNmQrpuPqh+kxWn7 5TxJfAne7UX4AX4ixJP8CJhmDUKx9VwUPWWFISljfoGGZRxqZrRHUtX+ZBK+8kFunIKF /vHXsioS8zLRK5cFoI2PMD6JYd/rsIakx4XCgi2pOCID+4SvoUOIYbooj0eaVI2IflXf 8i5Q== X-Gm-Message-State: AGi0PuaHSMXkEbzmppffEEIpuvtPkp+lvJK8H8Iau2qlNZ3lJAL15lgE VkusvvIGzeP2bMFyJRt5qBS/lP7oAGNzTYfYpL83/YbX2PwQcQ== X-Google-Smtp-Source: APiQypLRO8Z0YGNU74oBOjU6YLKbO/OsbwnLMfFZwwaYAN38At9SyJ4b01PlIOhJw+mtJiYh+Fr0DaZFlza/9SjCqt0= X-Received: by 2002:a17:90a:7302:: with SMTP id m2mr1751980pjk.7.1585804926305; Wed, 01 Apr 2020 22:22:06 -0700 (PDT) In-Reply-To: <86wo6yhj4d.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1034 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:246240 Archived-At: > > My suggestion is first to figure out how to do this stuff efficiently > > from within Emacs itself, as if the module interface were not part of > > the equation. We can add that aspect back later. > > There are two times the wisi code that wraps the parser needs access to > the buffer; first to copy the text, second to add text properties > (faces, indent values, navigation markers). There are usually many text > properties output by each parse. > > The positions and values of the text properties are computed by > functions that run after the complete syntax tree has been produced. In > wisi, those functions are added directly in the grammar source file > (where they are called "post-parse grammar actions"). In tree-sitter, I > assume they are called from some mode-author-written code that traverses > the syntax tree (wisi provides that internally). Except I see below that > the emacs tree-sitter package stores the syntax tree in the buffer. > The preferred approach with tree-sitter is querying: https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-wi= th-queries -- Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer