From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp Date: Wed, 18 Jan 2023 22:58:55 -0500 Message-ID: References: <875yd428ng.fsf@thornhill.no> <4e2dacb8-31b3-58e2-4987-2d22501c3324@yandex.ru> <87358827ku.fsf@thornhill.no> <847c7696-1884-d801-150e-4589a6c4b0e7@yandex.ru> <87h6woievr.fsf@thornhill.no> <86ee0347-2251-e4b7-1dd0-78949a423053@yandex.ru> <58908185-e09a-7920-553f-b9502d4f49f9@yandex.ru> <7eaf4b3a-cf4d-f0d4-243c-cde50f3d0dfd@yandex.ru> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16734"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Theodor Thornhill , 60894@debbugs.gnu.org, Mickey Petersen , Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 05:00:15 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 1pIM62-0004AP-Nk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 05:00:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIM5t-00073F-Gu; Wed, 18 Jan 2023 23:00: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 1pIM5r-00072k-QX for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 23:00: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 1pIM5r-0006TI-1s for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 23:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIM5q-0001TX-KZ for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 23:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2023 04:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60894-submit@debbugs.gnu.org id=B60894.16741007485579 (code B ref 60894); Thu, 19 Jan 2023 04:00:02 +0000 Original-Received: (at 60894) by debbugs.gnu.org; 19 Jan 2023 03:59:08 +0000 Original-Received: from localhost ([127.0.0.1]:42269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIM4x-0001Rv-LH for submit@debbugs.gnu.org; Wed, 18 Jan 2023 22:59:07 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIM4v-0001RQ-IL for 60894@debbugs.gnu.org; Wed, 18 Jan 2023 22:59:06 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8EEA6808F0; Wed, 18 Jan 2023 22:58:59 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 267988056A; Wed, 18 Jan 2023 22:58:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1674100738; bh=cPTTstmYpaUqgBkGdPP12OMIqWxNN0jm9KVKRGyi6o8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Yf7a7ERcSv60KMLrRmdKpGG+SYUjTpXOfDRTBTKj2KUd7iutK/rBoPI+d0lJHjNbi a3fb9iM2VAkHVL84SeRZAvPfE8gg4d3/TTGyjU1eoYBxN5QSqVRCdOYnzAEWhhYs3c T41SdgW6WHJ6EU5H+IaRpzZsWbe2zTGLKKOcNtqfrCUSoea3ssITrOBtoZbXXeEJR1 J+EwrL+o2epsrPjPtL9AVsgQPGovfbOAAtlSKxGJTMpQ4QTmx1GLkllVJWTaKcoSU4 MKrYoDp7aYjLKIbFSaRDLCyPHMiw74zAueVM3svSSJRrzvaDbzOYquRdrleVpb6pL6 bT50fQrHkCWiQ== Original-Received: from alfajor (unknown [24.62.78.115]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CCBF0120488; Wed, 18 Jan 2023 22:58:57 -0500 (EST) In-Reply-To: <7eaf4b3a-cf4d-f0d4-243c-cde50f3d0dfd@yandex.ru> (Dmitry Gutov's message of "Thu, 19 Jan 2023 05:30:43 +0200") 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:253673 Archived-At: >> I think `C-M-u` from within a LaTeX environment was one of the cases >> where it misbehaved (tho that one is not using SMIE). > Any chance SMIE is doing something different, or something > particularly correct? Could be. Maybe its simplistic approach rules out the bad cases? >>> Do you mean a hook like backward-up-list-function, or something smaller? >> Something like that. Maybe it could also be used for `expand-region` >> and `thing-at-point` kind of purposes maybe and could work even for >> treesit nodes that aren't "matching begin..end thingies". > A treesit node doesn't need an explicit "end" token, though. And that's what I want: I want to use successive `C-M-u` (or `expand-region`) to consider ever greater subexpressions that include the position from which I started and to do that at a fine grain. E.g. if I start with point on `b` in: a + b * c I'd like to first consider "b" then "b * c" then the whole thing. Stefan