> check_dirs_file() { > if [ "$(wc -l "$dirs_file")" -gt 10 ]; then > tmp_dirs_file="$(mktemp)" > sed '1d' "$dirs_file" > "$tmp_dirs_file" > cp "$tmp_dirs_file" "$dirs_file" > fi > } > > 3. M-x bash-ts-mode > 4. Move the cursor to the opening bracket of '$(mktemp)' and execute > 'forward-list'. It gives "No next group" message. The problem is that many tree-sitter grammars are so imperfect that even the current heuristics in 'treesit-forward-list' can't help to handle many cases. Here are a few examples: 1. bash-ts-mode $(a) => (command_substitution "$(" (command name: (command_name (word))) ")") Here the open paren is inside the node "$(". 2. ruby-ts-mode "#{a}" => (string " (interpolation "#{" (identifier) "}") ") Here the open curly brace is inside the node "#{". 3. elixir-ts-mode &(a) => (unary_operator operator: "&" operand: "(" (identifier) ")") Here the open paren is the second node "(" after "&". 4. go-ts-mode switch a { } => (expression_switch_statement "switch" value: (identifier) "{" "}") Here the open curly brace is far from the sibling "switch" node. (A similar case in 'for_statement' is already handled surprisingly well by the current heuristics in 'treesit-forward-list'.) I see only 2 variants how to allow 'forward-list' to handle all cases: 1. Improve the current heuristics to decide when to fall back to the default syntax-based navigation; 2. Explicitly specify the positions that should fall back to the default syntax-based navigation. I can't find a better heuristics, so probably we need to have another thing 'sexp-list' that specifies when to use 'forward-sexp-default-function' and 'forward-list-default-function'. This patch solves all the above problems: