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#67036: 30.0.50; treesit-forward-sexp not working properly in ruby-ts-mode Date: Thu, 02 May 2024 09:29:41 +0300 Organization: LINKOV.NET Message-ID: <868r0s7mlm.fsf@mail.linkov.net> References: <86bkc2nktq.fsf@mail.linkov.net> <83a5r2dw25.fsf@gnu.org> <45795de5-2064-3ab9-3cbb-c1b2018faf7c@gutov.dev> <864jh776bm.fsf@mail.linkov.net> <5a8d4404-47ec-9190-d80f-edc1fca26cf3@gutov.dev> <86msuxulvt.fsf@mail.linkov.net> <867cllrln9.fsf@mail.linkov.net> <864jc3ap3s.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35273"; 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: 67036@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 02 08:32:15 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 1s2PzK-0008zx-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 May 2024 08:32:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2Pyo-0000zY-HR; Thu, 02 May 2024 02:31:42 -0400 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 1s2Pyn-0000yR-3g for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 02:31:41 -0400 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 1s2Pym-0003Q5-RX for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 02:31:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2Pz8-0004Ob-Dc for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 02:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2024 06:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67036 X-GNU-PR-Package: emacs Original-Received: via spool by 67036-submit@debbugs.gnu.org id=B67036.171463151716884 (code B ref 67036); Thu, 02 May 2024 06:32:02 +0000 Original-Received: (at 67036) by debbugs.gnu.org; 2 May 2024 06:31:57 +0000 Original-Received: from localhost ([127.0.0.1]:41823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2Pz2-0004OG-M2 for submit@debbugs.gnu.org; Thu, 02 May 2024 02:31:56 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2Pz0-0004O1-Hk; Thu, 02 May 2024 02:31:55 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 99AB6E0003; Thu, 2 May 2024 06:31:25 +0000 (UTC) In-Reply-To: <864jc3ap3s.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 14 Apr 2024 19:25:11 +0300") X-GND-Sasl: juri@linkov.net 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:284273 Archived-At: close 67036 30.0.50 thanks >>>>>>>>> +# C-M-f on '[' doesn't jump to after ']' >>>>>>>>> +hash['key'] >>>>>>>>> + >>>>>>> >>>>>>> As discussed previously, there is no specific node which spans from [ to >>>>>>> ]. Some custom code could probably be written (there *are* leaf nodes for [ >>>>>>> and ]), but the current capabilities of treesit-thing-settings don't offer >>>>>>> a good way to plug that in. >>>>>> Like for point inside strings, this might require more general changes >>>>>> that take into account syntax tables. >>>>> >>>>> Possibly, but I expect a solution that doesn't use the syntax table would >>>>> be tried first. >>>> Since there is no available information from treesit, handling >>>> treesit-forward-sexp inside strings/comments could forward to the syntax table >>>> like `prog-fill-reindent-defun' forwards to `fill-paragraph'. >> >> Shouldn't treesit-forward-sexp provide a way for ts-modes to override >> the default handling? By default for all ts-modes such a hook could >> check if point is inside strings/comments then to use syntax navigation. > > This is now implemented in bug#68993. So here is the patch that > handles such cases as C-M-f jumping from '[' to ']' in > > hash[:key] > hash['key'] > > and from '{' to '}' in > > "abc #{ghi} def" > > diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el I guess this patch was ok. So I pushed it to master, and closed. Anything could be adjusted later if needed.