From aec608f1c1242b86465c8fdd3306970f50cc0ffe Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 16 Apr 2025 20:32:54 +0300 Subject: [PATCH] Change the default navigation sexp-type in 'elixir-ts-mode'. * lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): Call 'treesit-cycle-sexp-type' at the end to enable navigation across nodes defined by the tree-sitter thing 'sexp' by default (bug#76788). (cherry picked from commit a6d746400cdf237b58c60920f4cb9a38db12951d) --- lisp/progmodes/elixir-ts-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 43cb6d12cc3..8358ffdc63a 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -670,6 +670,7 @@ Return nil if NODE is not a defun node or doesn't have a name." (when (treesit-ready-p 'elixir) ;; The HEEx parser has to be created first for elixir to ensure elixir ;; is the first language when looking for treesit ranges. + ;; (In Emacs 31 this requirement is removed.) (when (treesit-ready-p 'heex) ;; Require heex-ts-mode only when we load elixir-ts-mode ;; so that we don't get a tree-sitter compilation warning for @@ -756,7 +757,9 @@ Return nil if NODE is not a defun node or doesn't have a name." ( elixir-function-call elixir-variable elixir-operator elixir-number )))) (treesit-major-mode-setup) - (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize))) + (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize) + ;; Enable the 'sexp' navigation by default + (treesit-cycle-sexp-type))) (derived-mode-add-parents 'elixir-ts-mode '(elixir-mode)) -- 2.39.5