]> git.eshelyaron.com Git - emacs.git/commitdiff
Change the default navigation sexp-type in 'elixir-ts-mode'.
authorJuri Linkov <juri@linkov.net>
Wed, 16 Apr 2025 17:32:54 +0000 (20:32 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 17 Apr 2025 07:09:26 +0000 (09:09 +0200)
* 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

index 43cb6d12cc3d71f036d724b004a34c4a5d3d84ee..8358ffdc63a8a1c5ebaa23c73f10d5b8f177a56b 100644 (file)
@@ -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))