Subject: Re: bug#62086: 29.0.60; ruby-ts-mode regressions

From: Dmitry Gutov <[email-masked]>
Date: Fri, 10 Mar 2023 00:02:14 +0200

Hi! Thanks for the report.

On 09/03/2023 19:24, Juri Linkov wrote:
> 'C-M-f' ('forward-sexp') commands currently are unusable in master
> because they skip too much.

I'm happy to discuss this sometime later, in a different report, 
preferably after Emacs 29's pre-release drops. We'd probably just need 
to tweak the relevant regexp.

But from what I see, most of the possible confusion stems from it 
jumping over implicit parens, just like over explicit ones. The addition 
of binary operators and assignments might also have something to do with it.

> So I relied on word motion commands like
> 'M-f' ('forward-word') to move in ruby-ts-mode.  But unfortunately
> some recent change broke even word motion in emacs-29, so no motion commands
> can be used in ruby-ts-mode, only motion by characters can be used with
> 'C-f' ('forward-char').  Here is a recipe for recent regression in emacs-29:
> 
> 0. emacs -Q
> 1. C-x C-f test/lisp/progmodes/ruby-mode-resources/ruby-parenless-call-arguments-indent.rb RET
> 2. M-x ruby-ts-mode RET
> 3. move point to after the first letter 'c'
> 4. type 'M-f' ('forward-word')
> 
> It skips two words in symbols.

I might have been too eager in propertizing symbol contents with the 
"symbol" syntax. Now fixed in emacs-29, commit ecdfd584a52.

> 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?