branch: externals/matlab-mode
commit d44c34cb0c7fa05c0f8fe0a64457b4603642c7a1
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>

    matlab-ts-mode--ei-error-query: setup when treesit-available-p
    
    This should prevent "Error: void-function (treesit-query-compile)".
    
    We only require matlab-ts-mode--ei-error-query to be valid when tree-sitter 
is available.
---
 matlab-ts-mode--ei.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/matlab-ts-mode--ei.el b/matlab-ts-mode--ei.el
index e62df71848..c152fc3596 100644
--- a/matlab-ts-mode--ei.el
+++ b/matlab-ts-mode--ei.el
@@ -454,7 +454,8 @@ N-SPACES-TO-APPEND is the number of spaces to append 
between nodes."
         (when (> n-spaces-to-append 0)
           (insert (make-string n-spaces-to-append ? )))))))
 
-(defvar matlab-ts-mode--ei-error-query (treesit-query-compile 'matlab 
'((ERROR) @e)))
+(defvar matlab-ts-mode--ei-error-query (when (treesit-available-p)
+                                         (treesit-query-compile 'matlab 
'((ERROR) @e))))
 (defvar-local matlab-ts-mode--ei-errors-alist nil)
 
 ;; matlab-ts-mode--ei-tmp-buf-indent is non-nil if doing m-matrix indent (in 
this case we know there

Reply via email to