From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp Date: Wed, 18 Jan 2023 20:55:33 +0200 Organization: LINKOV.NET Message-ID: <86ilh31xlm.fsf@mail.linkov.net> References: <875yd428ng.fsf@thornhill.no> <87o7qws1r1.fsf@masteringemacs.org> <86bkmw6m92.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7252"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 60894@debbugs.gnu.org, Mickey Petersen , Stefan Monnier To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 18 19:57:22 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 1pIDcg-0001hR-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Jan 2023 19:57:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIDcO-0006Fa-BH; Wed, 18 Jan 2023 13:57:04 -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 1pIDcM-0006FP-Jg for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 13:57:02 -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 1pIDcM-0000g5-9K for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 13:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIDcM-00013a-06 for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2023 18:57:01 +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.16740681864007 (code B ref 60894); Wed, 18 Jan 2023 18:57:01 +0000 Original-Received: (at 60894) by debbugs.gnu.org; 18 Jan 2023 18:56:26 +0000 Original-Received: from localhost ([127.0.0.1]:41848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIDbl-00012X-KA for submit@debbugs.gnu.org; Wed, 18 Jan 2023 13:56:26 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:47707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIDbj-00012E-Ck for 60894@debbugs.gnu.org; Wed, 18 Jan 2023 13:56:23 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 21623100005; Wed, 18 Jan 2023 18:56:14 +0000 (UTC) In-Reply-To: (Theodor Thornhill's message of "Wed, 18 Jan 2023 19:27:34 +0100") 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:253661 Archived-At: >>> Consider HTML (or anything in SGML club of languages). I would expect >>> sexp movement to move over a matched pair of tags. It currently does >>> not; the reason why is understandable when you know how `syntax-ppss' >>> does (or does not, as it were) work. (You can equally make an argument >>> that it should simply go to the end of an opening/closing node and not >>> the pair, but that is personal preference.) >>> >>> `nxml-mode' handles it properly; Combobulate handles it properly, too. >>> But Combobulate also falls back to the classic sexp behaviour if it >>> cannot find a suitable node in the direction of travel. >> >>While ‘forward-sexp’ moves over the next tag, there is also ‘C-c C-f’ >>(‘sgml-skip-tag-forward’) that moves over the whole element to the end tag. >>I'm not sure if sexp movement in nxml-mode is an improvement since >>there is no way to move over the tag only. >> >>To support both cases maybe ‘forward-sexp’ should move over the tag, >>and ‘forward-sentence’ over the whole element? > > Yes! This is what I find intuitive, and have tried to explain in my docstrings of the two. > > But I'm new in town and want all to at least discuss:) > > I can extract a forward-sexp-default-function to amend some of the damage? Maybe in a new html-ts-mode? I see there is libtree-sitter-html, but can't find the corresponding ts mode.