From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#62086: 29.0.60; ruby-ts-mode regressions Date: Fri, 10 Mar 2023 18:37:08 +0200 Message-ID: <7cd4d8d5-1bf9-1138-f95f-12933316ed72@yandex.ru> References: <86y1o5op2v.fsf@mail.linkov.net> <5abcf765-f8ce-9563-63aa-20c558409898@yandex.ru> <86bkl1gj15.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29199"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: 62086@debbugs.gnu.org To: Juri Linkov , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 10 17:38:22 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 1pafl7-0007QS-SM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Mar 2023 17:38:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pafkv-0004nZ-6C; Fri, 10 Mar 2023 11:38:09 -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 1pafko-0004ja-Th for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 11:38:02 -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 1pafko-0008C9-KL for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 11:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pafko-0001ag-5z for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2023 11:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Mar 2023 16:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62086 X-GNU-PR-Package: emacs Original-Received: via spool by 62086-submit@debbugs.gnu.org id=B62086.16784662386037 (code B ref 62086); Fri, 10 Mar 2023 16:38:02 +0000 Original-Received: (at 62086) by debbugs.gnu.org; 10 Mar 2023 16:37:18 +0000 Original-Received: from localhost ([127.0.0.1]:55655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pafk6-0001ZI-FD for submit@debbugs.gnu.org; Fri, 10 Mar 2023 11:37:18 -0500 Original-Received: from mail-ed1-f45.google.com ([209.85.208.45]:33456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pafk5-0001Z0-4m for 62086@debbugs.gnu.org; Fri, 10 Mar 2023 11:37:17 -0500 Original-Received: by mail-ed1-f45.google.com with SMTP id a25so23004067edb.0 for <62086@debbugs.gnu.org>; Fri, 10 Mar 2023 08:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678466231; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=VXj2iI4UHoLlO5PGpmfuhmsmDadq12QZhO/LVAfZ7o0=; b=HufESQkpzYwhH2AC0UmkfBNZzHJjS7dwij4qXKEmBXOMS2XT9tn+zedMBiwOk1VBM4 hyfKFSEJd6NNDAnVwbmOU130IxYXMMvoUDFrUVwrRWG0ChMWlbiSul3DsF0zXyyp5++4 7sC+rWQmyPTXCL1QunMenh8jeDrteR0YlwciRSQIvOQyhOtJqR3VcLK7ub1vm8UUb7g7 0Aiuol89wkuUnSNWNTNBvPxNzUC7hx6N6H46SkPN76DkMM0lcPV99MYunblUwo59KhuJ WQaXefkGr54EogOcMFS/03yZhVBAh3mTL02YS61PpeslEeUbBSiQTK5AfCLUq2djJCSt ZL4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678466231; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VXj2iI4UHoLlO5PGpmfuhmsmDadq12QZhO/LVAfZ7o0=; b=b8uZG9mvoaE5mhnBbGU24nv5fs38b7qwsxjwhhMENyL+OjHzTC5ami8WH1X3c30iBa awnkInGeX7NlyHpx9imGVNuYUFnQJ30kzWWT3JtNWxMgk0YWI9dsfRT88Fjdj2LUqoqQ Pw2ikm22KoLMxFV3X7GDOITnYBMl73sr2eAvVe8sObRcLGloiPitY+7r81za8GYIQSfE C8MPpKrGwFPjtumD3dcYuUvdoJhWSahv25kgemIQL1Ff9w9H1fqf6CaQDOvOeA1BtBqj CbJ1trTcnpbLxhac5WWrbjCQGPzljEvWSgCkUYzNCZBADrKHEQSTfH5blVfBiN88OoJc qzhQ== X-Gm-Message-State: AO0yUKU+2d7bciL0Au6h18qDRIBIE4A74uAfEdCvfMuEXJv/mtgcrD8a IdzWXpZDJaKKpp/cRI41r84= X-Google-Smtp-Source: AK7set9yofrHBzdbZki434qfRRl/9k9aaE2EJY+x51bMdB8KLiGHNgPxn3JoHAqQojgBab1PCpEyzA== X-Received: by 2002:a17:906:308e:b0:8f8:375e:f0b6 with SMTP id 14-20020a170906308e00b008f8375ef0b6mr27343469ejv.58.1678466231035; Fri, 10 Mar 2023 08:37:11 -0800 (PST) Original-Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id w7-20020a50d787000000b004c19f1891fasm215028edi.59.2023.03.10.08.37.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Mar 2023 08:37:10 -0800 (PST) Content-Language: en-US In-Reply-To: <86bkl1gj15.fsf@mail.linkov.net> 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:257704 Archived-At: On 10/03/2023 09:35, Juri Linkov wrote: >>> I don't know if the second bug is related to this, but while >>> in the same file, also type 'C-M-l' ('reposition-window'). >>> It raises the error: >>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p >>> nil) >>> treesit-end-of-defun() >>> end-of-defun(-1) >>> reposition-window(nil nil) >>> reposition-window(nil 89) >>> funcall-interactively(reposition-window nil 89) >>> command-execute(reposition-window) >>> This regression is also recent. >> I've managed to reproduce this, but only once. Do you see this every time? > I see it only in some files in test/lisp/progmodes/ruby-mode-resources/ > e.g. ruby-parenless-call-arguments-indent.rb, ruby-method-call-indent.rb, > ruby-block-indent.rb. But not in e.g. ruby-after-operator-indent.rb. > Also everywhere in test/lisp/progmodes/js-resources/js-indent-init-dynamic.js, > js-indent-init-t.js. But not in e.g. js-chain.js. Thanks, I can repro. I might have been trying the wrong binding at the end last night (C-l instead of C-M-l). The fix seems to be easy: diff --git a/lisp/treesit.el b/lisp/treesit.el index c118f5d52a4..b271a1f0c4b 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1882,6 +1882,7 @@ treesit-end-of-defun `treesit-defun-skipper'." (interactive "^p\nd") (let ((orig-point (point))) + (if (or (null arg) (= arg 0)) (setq arg 1)) (catch 'done (dotimes (_ 2) ; Not making progress is better than infloop. But I'm not quite sure if that is what we want to do. More naturally, I think, would be to remove the argument from treesit-end-of-defun altogether (and adjust the code accordingly), because end-of-defun-function is documented to take no arguments. The only other place where treesit-end-of-defun seems to be used is the binding set up by treesit-major-mode-setup. Why not keep the default bindings for these? When beginning-of-defun-function and end-of-defun-function are set appropriately, they should work fine. Don't they? Cc'ing Yuan on that subject.