Subject: 29.0.60; wrong-type-argument in treesit-indent-region when indenting a C buffer

From: Daniel Martín <[email-masked]>
Date: Tue, 07 Feb 2023 23:20:09 +0100

Steps to reproduce the problem:

emacs -Q
C-x C-f emacs/src/xdisp.c RET
M-x c-ts-mode RET
C-x h
TAB

Expected result:

The buffer is reindented.

Actual results:

The operation fails with this error:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  treesit-indent-region(1 1214226)
  indent-region(1 1214226)
  indent-for-tab-command(nil)
  funcall-interactively(indent-for-tab-command nil)
  call-interactively(indent-for-tab-command nil nil)
  command-execute(indent-for-tab-command)