bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#73404: 30.0.50; [forward/kill/etc]-sexp commands do not behave as ex


From: Juri Linkov
Subject: bug#73404: 30.0.50; [forward/kill/etc]-sexp commands do not behave as expected in tree-sitter modes
Date: Mon, 30 Dec 2024 09:15:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)

> Also added 'sexp-list' to c-ts-mode, js-ts-mode, ruby-ts-mode and
> html-ts-mode.  Addition of 'sexp-list' to other ts-modes is underway.

BTW, my initial intention was to add the thing 'list'.
But then I discovered that (treesit-thing-next (point) 'list)
uses the function 'list' instead of the thing 'list'.

However, the current 'sexp-list' as a two-word composite is too ugly.
Now I found a better replacement: 'group'.  This word is already used
in lisp.el such as in the docstring of 'forward-list':

  "Move forward across one balanced group of parentheses."

And the error messages: "No next group".

So exactly the same message will be used by

  (format-message "No next %S" pred)

where 'pred' will be 'group'.  IMHO, this looks better:

  (setq-local treesit-thing-settings
              `((html
                 (sexp ,(regexp-opt '("element" "text" "attribute" "value")))
                 (group ,(regexp-opt '("element"")))
                 (sentence "tag")
                 (text ,(regexp-opt '("comment" "text"))))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]