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#68993: treesitter support for forward-sexp-default-function Date: Sun, 11 Feb 2024 17:28:03 -0800 Message-ID: <12153B04-8B7E-43D4-8EC4-8931021F1965@gmail.com> References: <86y1bv6jsm.fsf@mail.linkov.net> <86a5o86wl5.fsf@mail.linkov.net> 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="15633"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68993@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 12 02:29:00 2024 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 1rZL80-0003sf-9P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Feb 2024 02:29:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZL7o-0007qx-F2; Sun, 11 Feb 2024 20:28:48 -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 1rZL7m-0007qf-Nx for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 20:28:46 -0500 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 1rZL7m-0005jN-FM for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 20:28:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZL82-0006ra-U3 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 20:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 01:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68993 X-GNU-PR-Package: emacs Original-Received: via spool by 68993-submit@debbugs.gnu.org id=B68993.170770132226314 (code B ref 68993); Mon, 12 Feb 2024 01:29:02 +0000 Original-Received: (at 68993) by debbugs.gnu.org; 12 Feb 2024 01:28:42 +0000 Original-Received: from localhost ([127.0.0.1]:39062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZL7h-0006qL-OR for submit@debbugs.gnu.org; Sun, 11 Feb 2024 20:28:42 -0500 Original-Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:48186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZL7e-0006pj-7v for 68993@debbugs.gnu.org; Sun, 11 Feb 2024 20:28:39 -0500 Original-Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5d81b08d6f2so2131429a12.0 for <68993@debbugs.gnu.org>; Sun, 11 Feb 2024 17:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707701296; x=1708306096; 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=V6hR1PPryX0Aj8lCOQ87tHuNZtozxg0zCmQN850w+Ec=; b=LZOGFKHMLKViEWL/I9YEOo8PRRvpjAxk8Fnw8CCTXhxkfS+Ruo/YmTQeK7tRuF31X9 j5LEpMgbSn+C1R59oqi+ODsGnwCTK8pcd0A0qkp+F7xI00WgK+/dBWoAbhBL/bE3YYSC 0q4dYf2Pw//x8CyGzWIlOZOGKgWT3OhpoLEv7sLfTQA0240LSyVDa56WYvA1G163iGBm 2/fGEG5TVRXpYG8RdS5WwJag8CENmXTTFKnLOyIguS2AnBvXLE07c0p+J7Of83c8LMOQ yYOhoKg7rxVi6TDabiTXnoIkCjy9AkPNC8DW/xi0k3Ra6t7alb5E6F4/IMx3whLayv2n LXoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707701296; x=1708306096; 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=V6hR1PPryX0Aj8lCOQ87tHuNZtozxg0zCmQN850w+Ec=; b=Jqmk1ncCAxXBmlSW9xQJSUqkIggVJbOvYLKmViYktkdLf2keJ3g7qBRXpUu2oeJstL Pp/zaRVBFN4lpm3VYArHZkHsys7pCcDFqRIDdFunuMQM4K/0QDCfGTYF68jbiCiOStAk xWBcgQX3PgZ70EGhTgUOYLFsy/Ei2+FYMvHL1qLNHmAJatm0M32ZggELW7XIANKGkBkh d/PUstX5vdMynvoNtkuDt97kHvYyvlnCMiTHGt8Vf+ocdq0zfQcTfJhk3jZYrkNwxOfP befu9wpjORCtKhjyAhM1if3H5cdHt4E0BY4zya1aDzeAT3/s3O3BtxlSDS2ZX6G2N5wl PPDg== X-Gm-Message-State: AOJu0YxEsDcXbaY3llOTqQvazLBX7JPj+0NfsRblKzZzk0h2BJdTcxtw 3/TzXF1O6/jCjO2uUBxP+2CY1LCNmnJU1FKQPQFChb+SvySXbm0EPBX/LGqb X-Google-Smtp-Source: AGHT+IFAyuh730tzSC0e+dxwkMBAuazk3n5g2so3NAbVM0bE6O8uxKhHeFvU9OGRQqGglFWmb982Ww== X-Received: by 2002:a05:6a20:2d1e:b0:1a0:56c9:609d with SMTP id g30-20020a056a202d1e00b001a056c9609dmr931591pzl.25.1707701295741; Sun, 11 Feb 2024 17:28:15 -0800 (PST) Original-Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id z5-20020aa79e45000000b006dd6c439996sm4271102pfq.161.2024.02.11.17.28.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2024 17:28:15 -0800 (PST) In-Reply-To: <86a5o86wl5.fsf@mail.linkov.net> 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:279880 Archived-At: > On Feb 10, 2024, at 9:46 AM, Juri Linkov wrote: >=20 > Hi Yuan, >=20 > Do you think 'comment' is a suitable name for 'treesit-forward-sexp'? > I'm unsure even if 'text' is a good name for = 'treesit-forward-sentence'. > But at least these two should be consistent with each another. >=20 > Maybe better to add the prefix 'default-' to both? > This will hint that the default function is used. >=20 > Then 'treesit-forward-sentence' will support types > 'sentence' and 'default-sentence'. > And 'treesit-forward-sexp' will support types > 'sexp' and 'default-sexp'. First there=E2=80=99s the =E2=80=9Ctext=E2=80=9D definition, then = treesit-forward-sentence uses it as a heuristic to get better results in = comments and strings, rather than the other way around. So for me it = doesn=E2=80=99t make much sense to say if =E2=80=9Ctext=E2=80=9D is good = or bad name for treesit-forward-sentence=E2=80=94it=E2=80=99s not for = treesit-forward-sentence to start with. My suggestion would be for both treesit-forward-sentence and -sexp to = use =E2=80=9Ctext=E2=80=9D for their heuristic. If someone wants more = customized behavior, they can always write a custom = forward-sentence/sexp function. Yuan=