From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Herman, Geza" Newsgroups: gmane.emacs.bugs Subject: bug#62302: 30.0.50; c/c++ tree sitter forward-sexp problem Date: Mon, 20 Mar 2023 21:40:26 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31112"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: 62302@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 20 21:41:17 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 1peMJe-0007pe-T4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Mar 2023 21:41:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peMJV-0005sW-Hr; Mon, 20 Mar 2023 16:41: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 1peMJT-0005s9-JQ for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 16:41: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 1peMJT-0000Xf-B9 for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 16:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peMJS-00051C-Ob for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 16:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Herman, Geza" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2023 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62302 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167934483819247 (code B ref -1); Mon, 20 Mar 2023 20:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Mar 2023 20:40:38 +0000 Original-Received: from localhost ([127.0.0.1]:56893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peMJ4-00050N-0n for submit@debbugs.gnu.org; Mon, 20 Mar 2023 16:40:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peMJ1-00050F-Hc for submit@debbugs.gnu.org; Mon, 20 Mar 2023 16:40:36 -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 1peMJ0-0005ok-Pu for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 16:40:34 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peMIw-0000PY-Ua for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 16:40:33 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id iw17so3027578wmb.0 for ; Mon, 20 Mar 2023 13:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679344828; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=C/+u47pVJdwsebMmVW+SVuxAGSy4EAg+TCEsdP8BEOQ=; b=RgxiITzagfG5Gbf/LipY2PHNCVd5aM+Qpbdk9aE1zrrCx/l+NNLG+s+S6qqKmA7rhW Ee1BdLgufbC69gI8F3HLFN9wYQOHbE/8UfcCu19ZmvuBjHpw8Uy+63mxSVUtYX5075us JfIs56CpT0AMjqSvGJ7n66Do1Ij2DwSZdeRKScjhZvUfGm4cASZ3r0hN8R5dt40aQYvF D0QRdvK0t7oqQc0cwhPb680EPwB7YEGC60bDxF+O0jV+nLpqqV1V+uX62YizoYycjcY7 N0qQGQMqLQ7ipaH+4vQyHF4hy/+ArEYRrSkSqtkqdDghbM7SYLNxEJeAglmBvyKQ2xPl YSqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679344828; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=C/+u47pVJdwsebMmVW+SVuxAGSy4EAg+TCEsdP8BEOQ=; b=cHlr84TgrPLXM7VV5/aGmkw06tqwHh6KWGnPIriU2oihKscvmKThQSt1Yvk2YuR6Ch LKnsoXiihDF+2qRHGDAawvTag6U+qCNh9OMaHwGP7JJ9dinQYcLdMbhFylqhZd+lebat gccNKlnFc4lHy5gEsbpWoWHV+D0NSj55osfipimTWPZ4Hbon+d+wRUCpw1h530F9EyLW RvG7oMvuxEZLQAhyt0So/om8VAsTuDe+D0aN1qdt3qnbKNhPxnCxtz/58x2ceATB0Z1X Sy+RCmQ3d56qrnPLCRhRO7mugGOpiqnx1JDBRbHzhO6cuxumJ6Ag3KJaqUCadrJ++hGp JmNg== X-Gm-Message-State: AO0yUKUK3pXq0G9+6+4GN466oSjgDZi2ueIuVjWD6xlG8XKAYGGxFqbL lNxMM+5alnblLtsvpseP82fQP2Qp/Pg= X-Google-Smtp-Source: AK7set9dU5unD9niMloEa8WZQHucuHq9ANwWwmkw20AofafPwLGhYolhtg30x7MGEXkvqiyFaLrdTg== X-Received: by 2002:a05:600c:2258:b0:3ed:290b:dc76 with SMTP id a24-20020a05600c225800b003ed290bdc76mr606963wmm.1.1679344828112; Mon, 20 Mar 2023 13:40:28 -0700 (PDT) Original-Received: from [10.9.10.122] (62-77-231-86.static.invitel.hu. [62.77.231.86]) by smtp.gmail.com with ESMTPSA id h20-20020a1ccc14000000b003dc522dd25esm11435658wmb.30.2023.03.20.13.40.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Mar 2023 13:40:27 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=geza.herman@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:258322 Archived-At: 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; } In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version  3.24.36, cairo version 1.16.0) of 2023-03-20 built on okoska Repository revision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101006 System Description: Debian GNU/Linux bookworm/sid Configured using:  'configure --with-native-compilation=aot --without-compress-install  --with-json --with-xinput2 --with-xwidgets --with-tree-sitter  --with-cairo' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB Important settings:   value of $LC_ALL: C.UTF-8   value of $LANG: en_US.UTF-8   value of $XMODIFIERS: @im=none   locale-coding-system: utf-8-unix Major mode: C++// Minor modes in effect:   tooltip-mode: t   global-eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   line-number-mode: t   indent-tabs-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t   hs-minor-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils hideshow c-ts-mode c-ts-common treesit comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads xwidget-internal dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 110613 15271)  (symbols 48 9248 0)  (strings 32 26736 1257)  (string-bytes 1 928972)  (vectors 16 18719)  (vector-slots 8 373020 18319)  (floats 8 32 48)  (intervals 56 274 0)  (buffers 984 13))