GNU bug report logs -
#77744
31.0.50; Inconsistent error signal in up-list-default-function and treesit-up-list
Previous Next
Reported by: Roman Rudakov <rrudakov <at> fastmail.com>
Date: Fri, 11 Apr 2025 14:28:02 UTC
Severity: normal
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Juri Linkov <juri <at> linkov.net> writes:
>>> 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)))
>> Yes, I forgot to mention it in the initial report. 'scan-error' is
>> signaled
>> by 'up-list-default-function' when it's called non-interactively,
>> but
>> 'treesit-up-list' signals 'user-error' in this case.
>
> Thanks for the bug report. I will push this patch tomorrow
> since currently the repo is down:
>
> diff --git a/lisp/treesit.el b/lisp/treesit.el
> index ae0ef56c65a..3cf3be5122c 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -3193,7 +3183,12 @@ treesit-up-list
> (goto-char (if (> arg 0)
> (treesit-node-end parent)
> (treesit-node-start parent))))
> - (user-error "At top level")))
> + (if no-syntax-crossing
> + ;; Assume called interactively; don't signal an
> error.
> + (user-error "At top level")
> + (signal 'scan-error
> + (list (format-message "No more %S to move
> across" pred)
> + (point) (point))))))
> (setq cnt (- cnt inc)))))
>
> (defun treesit-cycle-sexp-type ()
Thank you!
--
Best regards, Roman
This bug report was last modified 99 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.