From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.bugs Subject: bug#62752: html-ts-mode: treesit--simple-indent-eval: Wrong number of arguments: #, 3 Date: Mon, 10 Apr 2023 16:32:35 +0200 Message-ID: <9103509.CDJkKcVGEf@zarathustrawsp500> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3170385.5fSG56mABF" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40443"; mail-complaints-to="usenet@ciao.gmane.io" To: 62752@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 10 16:33:23 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 1plsaB-000AMy-66 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 16:33:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plsZs-0002BX-M0; Mon, 10 Apr 2023 10:33:04 -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 1plsZr-0002Aa-0J for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:33: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 1plsZq-0004nF-Oo for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plsZq-000612-AB for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2023 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62752 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.168113716223091 (code B ref -1); Mon, 10 Apr 2023 14:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Apr 2023 14:32:42 +0000 Original-Received: from localhost ([127.0.0.1]:35618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plsZV-00060N-ID for submit@debbugs.gnu.org; Mon, 10 Apr 2023 10:32:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plsZU-00060F-A0 for submit@debbugs.gnu.org; Mon, 10 Apr 2023 10:32:40 -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 1plsZT-000271-Rj for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:32:39 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1plsZS-0004fX-51 for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:32:39 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id v14-20020a05600c470e00b003f06520825fso7956296wmo.0 for ; Mon, 10 Apr 2023 07:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681137156; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=b1fs81iAS8dXyxMUz/mR0Y2dvjVNPNVd6VCgrHgs29g=; b=PxpRbdafwm2dZiGPr3iy+d1ffh1DhRMQly5EGZGNwctdUwo+Rf3gzOT97mP5k+1grh TcIfw+4EdQdWwyH9lpx1OcoogqkKXsKdpIzEQPdJuU0oxc0oFsAppAEFUR0aC1g7rUb9 +vuvNgsuHw+4yQnkiZstO5W4mZZgd5uu7GCMDOeddLocOUukq1qwexYXYv6IHMPHlnfB OIyFOVKS/6P1CQOD1HaQBPFZ86yt7BevtlKwo7ijNUc+AMDTsz4sm1TVnErDag0exejv gRg6Xp5OI9nMHkMBQ6E1KBofHakSJzL3aRHp0PhKyueLfRa9OVpHeZKQTD5AprpiBGTW YQsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681137156; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b1fs81iAS8dXyxMUz/mR0Y2dvjVNPNVd6VCgrHgs29g=; b=bFpJniuX4vv/ukneZNhRoUFlRM6knt8uoPYdIqnO7/D7iGkF6WIb0pSf2J/HnahT/v lL6Va7FLrVej+b8wSRbT9gARf/xLGwK+0VoJwopWSm5F9gY4TQNuWy9PoSqxvZfK0Eb2 OSJdqTkyZYj9wsrSEDAoeag0VrD7R+uI7JDORqu4spTE77nNJC4aaXnG1kzoMWFVbIXf uGmDG4NC7+lIiDhqgo6cFxkampG7zdpsZYNNZqfy7pxl/+n6qkRNMWbDQs7Dt/rRZOZ/ By0gQ2MZSfUJB6X9QmmY+EefZpLO46I8zGepySqCkmmwBCGq/Wb/PcIritGcHUAJr9x/ SmVg== X-Gm-Message-State: AAQBX9dhvWzce2LBqFjH7oJEQ7bL8j+n7iHa1V4Uc9uhZSr9CoXan19b J+EvVHMrZ6EfSYvcD1+jAoxH4MhYZoU= X-Google-Smtp-Source: AKy350alC1yfTWVBf4HKYNZ3J1LEwSeczz/lPB1Tw/OGWrvF/nSFfDzzvaF0RCNGYA4BJPoOz1qHYg== X-Received: by 2002:a1c:4c09:0:b0:3ed:3457:4e82 with SMTP id z9-20020a1c4c09000000b003ed34574e82mr7674742wmf.30.1681137156004; Mon, 10 Apr 2023 07:32:36 -0700 (PDT) Original-Received: from zarathustrawsp500.localnet (2-230-139-124.ip202.fastwebnet.it. [2.230.139.124]) by smtp.gmail.com with ESMTPSA id n6-20020a7bc5c6000000b003f072b22dbbsm12972561wmk.16.2023.04.10.07.32.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 07:32:35 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=v.pupillo@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, CONTENT_AFTER_HTML_WEAK=1, 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=no 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:259582 Archived-At: This is a multi-part message in MIME format. --nextPart3170385.5fSG56mABF Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, I found a bug in html-ts-mode. If you try to indent this simple html snippet (after enabling html-ts mode) and try to indent, say, the first or second line, emacs reports the following error: Matched rule: ((parent-is "fragment") point-min 0) treesit--simple-indent-eval: Wrong number of arguments: #, 3 Using parent-bol instead of point-min solves the problem. GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.6) of 2023-04-09 The patch is attached. The fragment is as follows: test

This is a heading

This is a paragraph.

Thank you. V. --nextPart3170385.5fSG56mABF Content-Disposition: attachment; filename="0001-Fixed-the-html-ts-mode-indentation-rule.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="0001-Fixed-the-html-ts-mode-indentation-rule.patch" >From 553358e481c4a81112d2ff84ae089ecfbfa20e12 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Mon, 10 Apr 2023 15:49:32 +0200 Subject: [PATCH] Fixed the html-ts-mode indentation rule. The indentation rule ((parent-is "fragment") point-min 0) in html-ts-mode causes an error if trying to indent nodes that have 'fragment' as parent. * lisp/textmodes/html-ts-mode.el (html-ts-mode--indent-rules): use parent-bol instead of point-min --- lisp/textmodes/html-ts-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index 58dcc7d8cad..a58e3665ff8 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -42,7 +42,7 @@ html-ts-mode-indent-offset (defvar html-ts-mode--indent-rules `((html - ((parent-is "fragment") point-min 0) + ((parent-is "fragment") parent-bol 0) ((node-is "/>") parent-bol 0) ((node-is ">") parent-bol 0) ((node-is "end_tag") parent-bol 0) -- 2.39.2 --nextPart3170385.5fSG56mABF--