From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#62302: 30.0.50; c/c++ tree sitter forward-sexp problem Date: Tue, 5 Sep 2023 16:50:10 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24247"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , theodor thornhill , geza.herman@gmail.com, 62302-done@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 06 01:51:25 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 1qdfpN-000663-7P for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Sep 2023 01:51:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdfp8-0008Vm-59; Tue, 05 Sep 2023 19:51:10 -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 1qdfp6-0008UD-DM for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 19:51:08 -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 1qdfoz-0004BW-De for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 19:51:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdfp0-0005PB-3W for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 19:51:02 -0400 Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Sep 2023 23:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 62302 X-GNU-PR-Package: emacs Mail-Followup-To: 62302@debbugs.gnu.org, stefankangas@gmail.com, geza.herman@gmail.com Original-Received: via spool by 62302-done@debbugs.gnu.org id=D62302.169395782420723 (code D ref 62302); Tue, 05 Sep 2023 23:51:01 +0000 Original-Received: (at 62302-done) by debbugs.gnu.org; 5 Sep 2023 23:50:24 +0000 Original-Received: from localhost ([127.0.0.1]:59869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdfoI-0005O1-KI for submit@debbugs.gnu.org; Tue, 05 Sep 2023 19:50:24 -0400 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:52686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdfoH-0005Nn-IP for 62302-done@debbugs.gnu.org; Tue, 05 Sep 2023 19:50:18 -0400 Original-Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-501bd6f7d11so2188098e87.1 for <62302-done@debbugs.gnu.org>; Tue, 05 Sep 2023 16:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693957811; x=1694562611; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=hxQ2tPy0MDkeXbrzyAFRQ9a6T/6oZxQHTbKiKR4ntWc=; b=mvYccMlAIL/KlmjyyV5yBC6v2wpvuIMyioxKAkIv7gh5eSLCIOb98iZBf8CarLEj5V rjgkMrPYUQOe1F3LwLlMf7RtEVwr3c8mfbNAzGZgX9ytVqQwL8orSE1BO0XeMDGMgDzs CFQDqeFrEtD6uT1i9z0BsWSTgYBq6kzLlQ6XK/M0mIf8CWp37W0Yxh2GL0QPhtyvfMFF JVQ6k76L81tFM4sPJUYYMBb6RZP0ohc/W8F8HZp5aMRv4f0Rsnsb1Pn8jwlYNZNby2bT XEw8iAzoC4bSGkgW4jGqfMd1GIhc2OkoxENpzpxo4hxGBrG/EgMRB2ZFJeS3DQNuFVRp 6WFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693957811; x=1694562611; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hxQ2tPy0MDkeXbrzyAFRQ9a6T/6oZxQHTbKiKR4ntWc=; b=BT8rJrQU1XGch7Q1eVvWB3lDvRbfoftMHvHfvbiLeA02qbqqS84I7ViXFWAg5FmlED tFHwFEBHoBYo+W9Gf+pVQn+iQCK8b7Z722WXwlfxKwbhP3vvXlaf/w/e5GxoMoie5IBZ ju5YvrUbmTq1K/Xm9TnwVkXF/Xsa8Z529KdBtyPznn1mNHNiSMvGbusCxBJIlolMZjjh WKhCWGPA2rbi35KOzzdTR/L+onfR11/n+CrMSEios5xJef/B0qH1pHY3PaICzZrF93BI o9ig00D+4SlpQYCT4//3lZdR4kmyvMOuavhKbSr6w6pU82u3Wjw0RcmYqf9GoJHPDxEz 7ARg== X-Gm-Message-State: AOJu0YxxP+f9els/46zJv/e/KK8UVVfwDQVij00s+H7L+9E8p2aBBSie YDW6mIhokYth53rlKyMjOQyULVye3oxfEBe5ntc= X-Google-Smtp-Source: AGHT+IG0eM0UyVWoimlOpMGYbMp4PpwUcjmqVJveEUWCkf11dmZi99HT4d03ILItuuFxIIW1dBlN4EfgfHpCT/chQk4= X-Received: by 2002:a05:6512:2393:b0:500:b5db:990b with SMTP id c19-20020a056512239300b00500b5db990bmr1030209lfv.47.1693957810608; Tue, 05 Sep 2023 16:50:10 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 5 Sep 2023 16:50:10 -0700 In-Reply-To: (Yuan Fu's message of "Thu, 6 Apr 2023 14:55:11 -0700") 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:269439 Archived-At: Yuan Fu writes: > Eli Zaretskii writes: > >>> 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. > > Missed this, sorry :-) > > I modified the definition of "sexp" in c/c++-ts-mode. I think new > definition is intuitive but only time will tell. The new definition > works on the little example in this report. > > Yuan It seems like this has been fixed, so I'm closing this bug report.