GNU bug report logs - #62302
30.0.50; c/c++ tree sitter forward-sexp problem

Previous Next

Package: emacs;

Reported by: "Herman, Geza" <geza.herman <at> gmail.com>

Date: Mon, 20 Mar 2023 20:41:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 62302 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Herman, Geza" <geza.herman <at> gmail.com>, Yuan Fu <casouri <at> gmail.com>,
 Theodor Thornhill <theo <at> thornhill.no>
Cc: 62302 <at> debbugs.gnu.org
Subject: Re: 30.0.50; c/c++ tree sitter forward-sexp problem
Date: Thu, 06 Apr 2023 13:12:01 +0300
> Date: Mon, 20 Mar 2023 21:40:26 +0100
> From: "Herman, Geza" <geza.herman <at> gmail.com>
> 
> 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.




This bug report was last modified 1 year and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.