From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62302: 30.0.50; c/c++ tree sitter forward-sexp problem Date: Thu, 06 Apr 2023 13:12:01 +0300 Message-ID: <83jzypqpzi.fsf@gnu.org> References: 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="24501"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62302@debbugs.gnu.org To: "Herman, Geza" , Yuan Fu , Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 12:12:33 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 1pkMbZ-0006Dr-AQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 12:12:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkMb7-0008Hi-9y; Thu, 06 Apr 2023 06:12:05 -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 1pkMb5-0008HH-Hb for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:12:03 -0400 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 1pkMb5-0001md-7I for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkMb4-0007hm-KJ for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 06:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 10:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62302 X-GNU-PR-Package: emacs Original-Received: via spool by 62302-submit@debbugs.gnu.org id=B62302.168077590229585 (code B ref 62302); Thu, 06 Apr 2023 10:12:02 +0000 Original-Received: (at 62302) by debbugs.gnu.org; 6 Apr 2023 10:11:42 +0000 Original-Received: from localhost ([127.0.0.1]:53478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMaj-0007h7-UB for submit@debbugs.gnu.org; Thu, 06 Apr 2023 06:11:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkMai-0007gl-4Y for 62302@debbugs.gnu.org; Thu, 06 Apr 2023 06:11:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkMac-0001MV-9O; Thu, 06 Apr 2023 06:11:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=xD75lPtOfIBXAWM5WeHmvoYz/M7sHpP+zIcNQw+3EaQ=; b=e6xiuYm3TkTEF9SSZoTe kZnAqvm2SLPagpWrwAkH0jsxFQ6M/vb2PXjAV2eXEsNW92IyVqssXZFuvSoe+dc0r8hI7n2dOpvLV A1ggsVSyl6DAvVBceGCEJDzujUbOASxNKmoqhdc7tcD1tPGvw2qHKtUZKlafqkiSqHoHagg0wTYaE 3RCOyK/rP25Czux8h7LT19txauVfgSXEAqVqyaECf/aMRRLcm1X1RFP+g96ItLlLVBa6o4n41cXLS UD2u1tXxBsOrNtUx+F26F8hxXxJXXpWB75UM/yUoFrLFJMhfOB4RP+YiZi5FQjZqwvbC4rmbLfkC9 IC5+PYatfJeJ2w==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkMaa-0002si-Iq; Thu, 06 Apr 2023 06:11:34 -0400 In-Reply-To: (geza.herman@gmail.com) 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:259305 Archived-At: > Date: Mon, 20 Mar 2023 21:40:26 +0100 > From: "Herman, Geza" > > With tree sitter, forward-sexp behaves a little strange. To reproduce: >  - copy the little example program below into a c++-ts-mode buffer >  - move the point to the opening curly brace of "main() {" >  - M-x forward-sexp > > This will move the point to the space character in "int a;". But without > tree sitter, this moves the point to the closing brace of main (I > believe this is the correct behavior). > > I noticed this problem because hideshow behaves strangely with tree sitter: >  - enable hideshow mode (M-x hs-minor-mode) >  - move the point to the same opening brace >  - M-x hs-toggle-hiding > > Hideshow should hide the whole body of main, but instead it only hides > parts of the body, and the buffer ends up like this: > > int main() {... a; >     } >    int b; > } > > If I set forward-sexp-function to nil, the problem goes away. I think > this issue is somewhat related to #60894 > > Here's the little example program: > > int main() { >     if (false) { >         int a; >     } >     int b; > } Theo, Yuan: any comments? Can you look into fixing this? Thanks.