From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61374: 30.0.50; Wrong mark-sexp with tree-sitter Date: Thu, 9 Feb 2023 17:14:03 +0100 Message-ID: <20230209161403.xfh5b2emefivrjai@Ergus> References: <875ycbitav.fsf.ref@aol.com> <875ycbitav.fsf@aol.com> <835ycbnxyc.fsf@gnu.org> <871qmzb56k.fsf@thornhill.no> <83fsbfmd75.fsf@gnu.org> <87y1p79nvj.fsf@thornhill.no> <838rh7m7q8.fsf@gnu.org> <87sfff9jum.fsf@thornhill.no> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38748"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61374@debbugs.gnu.org, Eli Zaretskii , casouri@gmail.com To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 09 17:15:16 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 1pQ9Zr-0009q3-9r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Feb 2023 17:15:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ9Zg-0008RG-Tz; Thu, 09 Feb 2023 11:15: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 1pQ9Ze-0008Qk-B0 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:15: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 1pQ9Zd-0001w8-Va for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:15:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQ9Zd-0001I3-RK for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 11:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2023 16:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61374 X-GNU-PR-Package: emacs Original-Received: via spool by 61374-submit@debbugs.gnu.org id=B61374.16759592574875 (code B ref 61374); Thu, 09 Feb 2023 16:15:01 +0000 Original-Received: (at 61374) by debbugs.gnu.org; 9 Feb 2023 16:14:17 +0000 Original-Received: from localhost ([127.0.0.1]:33436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ9Yu-0001GZ-Fj for submit@debbugs.gnu.org; Thu, 09 Feb 2023 11:14:16 -0500 Original-Received: from sonic312-21.consmr.mail.bf2.yahoo.com ([74.6.128.83]:34533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ9Ys-0001GI-2F for 61374@debbugs.gnu.org; Thu, 09 Feb 2023 11:14:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1675959248; bh=UhTBZ39IkGex2TrpBpGt4mih2kuPa5TK41vOlXc/SNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=tKt0Fj17ANWQ5LxE1FUOS780y5G8Lln3ujTyhb+jLWK1iGfCyC47H/i7Z244xKVIH+i8JhJCHEsUBFnxAGgrOqgpVRqX/k/APMoE/70/DpkMh1QmNfCcuTgrbCNi0tSQ4SQV1C6N1eAdho+WBuyCXm8AcOX3NT1UAio1MX+eWdSFbHcFWVySrO6lzY8Pld0lK61lxNsqeWo5ZnOHaQwaibxJT0NnWtNejlM4qNpq8cFvTwM5k4mZoRkgvvOy8oGtHOg+i4UQmn/HgLjrWuhH7IBdDgkeySQ1P6NiSGhcVsiDO6bl7WVi7srlJbI4+agNtS/KDiTvrWpFBUadMcGM4A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1675959248; bh=O3CsPGempa2U3KBqBPKDWLRA0LOwninCRN2i7GNSuRb=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=Fs51aH0T23SordqluM5bRft0CjvFucH7P8K0vVNM/pwwSE3HIUmh/qtNl09ar2sZBCMRqhdqZBieNryHEOuYblyF3D9S1v4mv1m+V8Cnwr4mUFjwOZVWZXLm4UXJmez2acL3eNrwTO6kq+zpXP1tZzJxpO8KAaSNQWYQXtx7t/cNRZoj6yuJ6xYfCQ/wxeBgXeT7vNBwYCBdLeprvdNbpRDlRA1mSAKozXLGCmAl8TZGatofDAyMVUaXk9JHLZWS7Nj6Bh8F1CZmhD7TWXi2jOC1ObbjvPq0bnshHYOzz1EmyXjhMZcon0KimGKZ9mpW2OA8bRdCSNR6pUF0ZLvUHg== X-YMail-OSG: rrNFQXkVM1n.qVAhfRXjsmh1G8x9TC0v942lTxvlZLiZWfSgHXmekqBmDb8kwid lpZ5JNsulf95kU5hXkhn2RbIggeYKwlHFMi4wzuaj4qYMZwSBR_nDN_O_6nHwx47rG2OyKHc7urk rg6T9mttxPGrb2XbI0n5O8GWutY77VFvwrPqf.lstdjLcgZV0Upeib4UYRRNOjcxrJ7FMWzfJ6hg JfBRF5yjIUG87aG16deWFL09juCulaTZB_CLZhVyoLMKj_cBmOUd340ZrMWb2JHwHHAL_pmWe_Ps 71YYgGuFUuNIjNbuKPUZTszQ88rQb8ZlhpHrYOxD2ATaywfuOwt2nKuSSFLWlC.mW8fYpoGBNetG oPpzW8MP1XqB_wU3gq0JcmR.naleG4.d8SrT9pLAmlkxSy5nkFWSeMtbl_MLNNT7ZL2DylkivXMy YikpvfeCoQGqV.KN4FseatIEb2vQjXXhri1VI2WN.rPIKlo3O1SUbJvCMVJUtCkyDqH.PFdPOngJ 2Ay8wDmTTA__mOW5Ngkzi7cpjyKjfgKHN1FjvI04V.1.BR2W8muHEnbmj0Y0z0Jv4W47iL0EI_gu tDiSJmONfixm_yFknduTljR42fGKojla.rac2na3fDGPRNnbGBfc_0ACQBGFtOv0TYkgiWu491LP RYBBvYSXPtRL5txrr6emvWSjPIM5b5Plk_y8U9XCGCJGHtjMLcqoOOqStcZMSOgNgVGAhWBsj.rL FUfRQcDs4aqHNFyQ4bp3O195zTq85jYikPRmLRc7m1dbtwvXoi6BTJoW80LHH7JGaFGSBfqL.t9R 3AkW8Qw86lNSuT6p3PzDT1HioohOCFPQc8CJUBRz1l X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Thu, 9 Feb 2023 16:14:08 +0000 Original-Received: by hermes--production-ir2-65c64dfd66-vsc2c (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4fe6d3f2c2863519eac7f39c24b3a0a3; Thu, 09 Feb 2023 16:14:05 +0000 (UTC) Content-Disposition: inline In-Reply-To: <87sfff9jum.fsf@thornhill.no> X-Mailer: WebService/1.1.21161 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol 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:255232 Archived-At: On Thu, Feb 09, 2023 at 12:08:49PM +0100, Theodor Thornhill wrote: >Eli Zaretskii writes: > >>> From: Theodor Thornhill >>> Cc: spacibba@aol.com, casouri@gmail.com, 61374@debbugs.gnu.org >>> Date: Thu, 09 Feb 2023 10:41:52 +0100 >>> >>> > Can you show some examples that illustrate these issues? I'm not sure >>> > I follow your line of reasoning, and thus cannot understand the >>> > relevant considerations and decisions, and their expected effects on >>> > behavior. >>> > >>> > Thanks. >>> >>> >>> consider same code as in the first mail: >>> >>> { >>> vector myvar; >>> } >>> >>> >>> If point is before the first curly, C-M-f will move to after the semi. >>> >>> >>> if "compound_statement" is added to the regexps, it will move to after >>> the closing curly - all good. >>> >>> Now if point is at the c in 'vector', now we will also move to after the >>> closing curly, not the first space or after the semi. >> >> Sounds like the treesit sexp movement doesn't have any notion of the >> "level" of the sexp or something? IOW, it doesn't know about the >> "innermost" sexp at point? If so, can we teach treesit.el about that? >> > >Yes, I think we should too. I'll look into it. > Hi: I am not aware of the details in the treesit.el implementation for emacs, but the treesit-api already provides the ts_node_start_point and ts_node_end_point functions which are intended for this use. Are we relying on that? >> Or am I missing the point? > >Nope, don't think so! > >Theo