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

From: Juri Linkov <[email-masked]>
Date: Fri, 10 Mar 2023 09:35:46 +0200

>> '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.

That's the problem: some implicit parens are unexpected.
But let's adjust this later in another report.

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

Thanks, I confirm this is fixed.

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