From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mohammed Sadiq Newsgroups: gmane.emacs.bugs Subject: bug#61001: 29.0.60; c-ts-mode: A recent update broke indent-according-to-mode Date: Sun, 22 Jan 2023 12:59:14 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39919"; mail-complaints-to="usenet@ciao.gmane.io" To: 61001@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 22 08:30:12 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 1pJUns-000ACC-1V for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Jan 2023 08:30:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJUnm-0008GS-NY; Sun, 22 Jan 2023 02:30:06 -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 1pJUnj-0008GJ-78 for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 02:30:04 -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 1pJUni-0004NP-Ow for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 02:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJUni-0002Vn-Ge for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 02:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jan 2023 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61001 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.16743725669585 (code B ref -1); Sun, 22 Jan 2023 07:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jan 2023 07:29:26 +0000 Original-Received: from localhost ([127.0.0.1]:50523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUn7-0002UW-RS for submit@debbugs.gnu.org; Sun, 22 Jan 2023 02:29:26 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:51552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUn6-0002UP-8R for submit@debbugs.gnu.org; Sun, 22 Jan 2023 02:29:24 -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 1pJUn4-0008DI-S1 for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 02:29:23 -0500 Original-Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJUn2-0004FO-IA for bug-gnu-emacs@gnu.org; Sun, 22 Jan 2023 02:29:22 -0500 Original-Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id 5527340003 for ; Sun, 22 Jan 2023 07:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sadiqpk.org; s=gm1; t=1674372554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thu+wtCnW1g6l69f6rF4SBu6A5nWbkWk6ZY5Ar6RvZE=; b=fwhmcEgJNCYw/9oyk+s7Zdmzg62n2TJFqwnx2ygJnWdjF9zNBnsvdo6nM3rTaUMRF1fsBS LqJS0mx9ixOCkTcx4CrKo4c7BnbEhElzv0kXGRqisMxCzzERWQTRysq1GHfaPmqLX9lcML uov+Vnam0yg4NqJXaQ2WGxSZXFdp3h9bLMBBbJIT4K05VG+Ob2eLKeGbiC1oLeFUcOmOVb v0AbOSLOrjA+VjJ2LE4zCpxe75VjZKZR1dKE8DkSJS4pDf1LLdvXEH+ZpmqWqBKW4V9JQA 0iUSy5AAczilh0koK5PSPEMEyWlJkHWIcjyci4ezdh2QeSvyEaR6/mI4kLS/Yg== X-Sender: sadiq@sadiqpk.org Received-SPF: pass client-ip=2001:4b98:dc4:8::222; envelope-from=sadiq@sadiqpk.org; helo=relay2-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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:253909 Archived-At: A recent update in c-ts-mode broke indent-according-to-mode. Some test cases in my elisp scripts fails to succeed after a recent update. The indentation seems to work fine when editing C source files though. Minimal reproducible example (save to test.el): (let ((buffer (generate-new-buffer "temp.c"))) (with-current-buffer buffer (c-ts-mode) (insert "int main() {\n if ") (indent-according-to-mode))) Execute the file with: emacs -Q -batch -l test.el Error log: Error: treesit-indent-error ("Couldn't find the preset corresponding to expression" c-ts-mode--looking-at-star) mapbacktrace(#f(compiled-function (evald func args flags) #)) debug-early-backtrace() debug-early(error (treesit-indent-error "Couldn't find the preset corresponding to expression" c-ts-mode--looking-at-star)) signal(treesit-indent-error ("Couldn't find the preset corresponding to expression" c-ts-mode--looking-at-star)) treesit--simple-indent-eval(c-ts-mode--looking-at-star) mapcar(treesit--simple-indent-eval ((parent-is "comment") c-ts-mode--looking-at-star)) treesit--simple-indent-eval((and (parent-is "comment") c-ts-mode--looking-at-star)) treesit--simple-indent-eval(((and (parent-is "comment") c-ts-mode--looking-at-star) # # 15)) treesit-simple-indent(# # 15) treesit--indent-1() treesit-indent() indent-according-to-mode() (save-current-buffer (set-buffer buffer) (c-ts-mode) (insert "int main() {\n if ") (indent-according-to-mode)) (let ((buffer (generate-new-buffer "temp.c"))) (save-current-buffer (set-buffer buffer) (c-ts-mode) (insert "int main() {\n if ") (indent-according-to-mode))) eval-buffer(# nil "/home/sadiq/test.el" nil t) load-with-code-conversion("/home/sadiq/test.el" "/home/sadiq/test.el" nil t) load("/home/sadiq/test.el" nil t) command-line-1(("-l" "test.el")) command-line() normal-top-level() Generic tree-sitter indentation error: "Couldn't find the preset corresponding to expression", c-ts-mode--looking-at-star In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.16.0) of 2023-01-22 built on purism Repository revision: e74ba72a6a34221abf47145ecf0ec4fc8cda2555 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101006 System Description: Debian GNU/Linux bookworm/sid