(defun jm~lua-ts-send-thing (point) "Send thing near POINT to the inferior Lua process." (interactive "d") (when-let* ((node (treesit-node-at point)) (parent (treesit-parent-until node (lambda (p) (string-match-p (rx (or "do_statement" "for_statement" "function_call" "function_declaration" "if_statement" "repeat_statement" "while_statement")) (treesit-node-type p))) t))) (lua-ts-send-region (treesit-node-start parent) (treesit-node-end parent))))