Subject: Re: bug#77744: 31.0.50; Inconsistent error signal in up-list-default-function and treesit-up-list

From: Juri Linkov <[email-masked]>
Date: Fri, 11 Apr 2025 19:25:17 +0300

> In Tree-sitter-based major modes, when up-list (or backward-up-list) is
> used, the operation is delegated to the treesit-up-list function. In
> traditional major modes, this is typically handled by
> up-list-default-function if a custom up-list-function is not defined. When
> the top level is reached, up-list-default-function signals scan-error, but
> treesit-up-list signals user-error.

This is because 'up-list-default-function' signals both:

  (if no-syntax-crossing
      ;; Assume called interactively; don't signal an error.
      (user-error "At top level")
    (signal (car err) (cdr err)))