From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Wed, 07 Dec 2022 09:51:35 +0000 Message-ID: <87mt7zplpf.fsf@posteo.net> References: <87lenlnjc1.fsf@posteo.net> <87k035vsph.fsf@thornhill.no> <87h6y8oq0x.fsf@posteo.net> <875yeox1hs.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24412"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 59853@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 07 11:13:19 2022 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 1p2rQU-0006Ck-I8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Dec 2022 11:13:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2rQJ-0000QG-Kh; Wed, 07 Dec 2022 05:13:07 -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 1p2rQE-0000L3-Ab for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 05:13:05 -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 1p2rQE-0002HU-1c for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 05:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2rQD-00023N-TU for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 05:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Dec 2022 10:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59853 X-GNU-PR-Package: emacs Original-Received: via spool by 59853-submit@debbugs.gnu.org id=B59853.16704079227842 (code B ref 59853); Wed, 07 Dec 2022 10:13:01 +0000 Original-Received: (at 59853) by debbugs.gnu.org; 7 Dec 2022 10:12:02 +0000 Original-Received: from localhost ([127.0.0.1]:49195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2rPF-00022F-H5 for submit@debbugs.gnu.org; Wed, 07 Dec 2022 05:12:02 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:42957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2rPB-000222-OD for 59853@debbugs.gnu.org; Wed, 07 Dec 2022 05:11:59 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 96B71240027 for <59853@debbugs.gnu.org>; Wed, 7 Dec 2022 11:11:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1670407911; bh=Wvzgyxe0xGIwPm0aVKFQPJbJ8FZyuKzfmNogeWIOCI0=; h=From:To:Cc:Subject:Date:From; b=ZRK/OZwsVL26DORNFWVMjjACyl1zS/ZnP22icXHsz8m40w9W9CGjIpzFC388cWOMH CdAHL0qtSNaVGXWKJXvFT6cU+sihxhIrpn0nzlwuv9sY3wqvOwuIcKWvvCBYvr+kAE 4UPOZmiMSPi8wQv/KOaAsvm3Mf9AUZF4JoP4VuQA79/DvE9khqCfs2teJKksM2QDvz nKt2V9jZ8WByfMG7KK8W8jDLjiFKgOilqXuz6Sk2d/no0YliW2dJXfuke9zaMiRDNa Vkh4XZohvUJajQWtj0jwn2wOldX/fejy5qBdDsPjoF7uwvg1yKfwmzMUYizTbaYFW1 EpRThz1gg/nLA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NRtNy4PP4z6tqw; Wed, 7 Dec 2022 11:11:46 +0100 (CET) In-reply-to: <875yeox1hs.fsf@thornhill.no> 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:250173 Archived-At: Theodor Thornhill writes: > Not sure I can reproduce this. Sorry, I made a mistake in my description. I additionally noticed additional odd results in java-ts-mode. Let me try again: > p[u]blic abstract class Class { > public static interface Interface { > void someMethod(); > [*] > void otherMethod(); > [}] > } 1. When point is at the "u" in "public", narrow-to-defun cuts off "pu" and moves point to "b". 2. When point is anywhere in the first line of the class declaration, mark-defun highlights "void otherMethod()", instead of the entire class declaration. 3a. When point is at the [*] in between someMethod and otherMethod, narrow-to-defun captures "void otherMethod()". I feel that since the methods inside the interface declaration have no bodies, it makes more sense to capture the entire interface definition if point is at [*]. 3b. Arguably, even if point were on the method declarations, we might still want to (as plain java-mode does) capture the entire interface definition, since body-less method declarations don't feel especially defun-like. 4. When point is on the closing bracket of the interface definition, narrow-to-defun captures > void otherMethod(); > } > } which looks quite unusual to me.