all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Juri Linkov <juri@linkov.net>, Yuan Fu <casouri@gmail.com>
Cc: 62086@debbugs.gnu.org
Subject: bug#62086: 29.0.60; ruby-ts-mode regressions
Date: Fri, 10 Mar 2023 18:37:08 +0200	[thread overview]
Message-ID: <7cd4d8d5-1bf9-1138-f95f-12933316ed72@yandex.ru> (raw)
In-Reply-To: <86bkl1gj15.fsf@mail.linkov.net>

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 
<remap> <end-of-defun> 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.





  reply	other threads:[~2023-03-10 16:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 17:24 bug#62086: 29.0.60; ruby-ts-mode regressions Juri Linkov
2023-03-09 18:08 ` Eli Zaretskii
2023-03-10  7:29   ` Juri Linkov
2023-03-09 22:02 ` Dmitry Gutov
2023-03-10  7:35   ` Juri Linkov
2023-03-10 16:37     ` Dmitry Gutov [this message]
2023-04-03 16:29   ` Juri Linkov
2023-04-03 20:42     ` Dmitry Gutov
2023-04-04  7:16       ` Juri Linkov
2023-04-05  0:06         ` Dmitry Gutov
2023-04-05  6:24           ` Juri Linkov
2023-04-05 14:58             ` Dmitry Gutov
2023-04-05 16:25               ` Juri Linkov
2023-04-05 16:36                 ` Dmitry Gutov
2023-04-11 16:53                   ` Juri Linkov
2023-04-11 23:30                     ` Dmitry Gutov
2023-04-12  7:05                       ` Yuan Fu
2023-04-12 15:31                         ` Dmitry Gutov
2023-04-12 20:13                           ` Dmitry Gutov
2023-04-12 21:50                             ` Yuan Fu
2023-04-12 21:56                               ` Dmitry Gutov
2023-04-12 22:11                                 ` Yuan Fu
2023-04-15  0:08                                   ` Yuan Fu
2023-04-13 17:42                             ` Juri Linkov
2023-04-14 17:03                               ` Juri Linkov
2023-04-12  7:30                       ` Eli Zaretskii
2023-04-12 15:31                         ` Dmitry Gutov
2023-04-12 15:40                           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cd4d8d5-1bf9-1138-f95f-12933316ed72@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=62086@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.