diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 6c406a8acd9..f5cd36c68c7 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -1318,7 +1318,8 @@ in your init files." ;; Create an "for-each" parser, see `c-ts-mode--emacs-set-ranges' ;; for more. (when c-ts-mode-emacs-sources-support - (treesit-parser-create 'c nil nil 'for-each)) + (setq-local treesit-primary-parser + (treesit-parser-create 'c nil nil 'for-each))) (treesit-parser-create 'c) ;; Comments. diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 815827ed13c..a3e11658468 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -701,7 +701,8 @@ Return nil if NODE is not a defun node or doesn't have a name." (require 'heex-ts-mode) (treesit-parser-create 'heex)) - (treesit-parser-create 'elixir) + (setq-local treesit-primary-parser + (treesit-parser-create 'elixir)) (setq-local treesit-language-at-point-function 'elixir-ts--treesit-language-at-point)