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

    matlab-ts-mode: update to latest matlab ts abi/14 commit 3e7a2a8
---
 matlab-ts-mode.el                                  |   4 +-
 .../font_lock_cd_dot_dot_issue88.skip.txt          |   1 -
 .../font_lock_cd_dot_dot_issue88_expected.txt      |   6 +
 ...ue84.m => font_lock_continuation_fcn_issue84.m} |   5 -
 ...=> font_lock_continuation_fcn_issue84.skip.txt} |   2 +-
 .../font_lock_continuation_issue84.m               |   8 -
 .../font_lock_end_method_issue86.m                 |  12 ++
 .../font_lock_end_method_issue86_expected.txt      |  12 ++
 .../font_lock_error.m                              |   2 +-
 .../font_lock_error_expected.txt                   |  28 ++--
 .../font_lock_error_issue51_end_expected.txt       |   4 +-
 ...k_fcn_call_with_expression_issue83_expected.txt |  14 ++
 .../font_lock_for_range_in_parens_issue89.skip.txt |   1 -
 ...t_lock_for_range_in_parens_issue89_expected.txt |   7 +
 ..._issue87.m => font_lock_if_greedness_issue92.m} |   6 +-
 .../font_lock_if_greedness_issue92.skip.txt        |   1 +
 ...ock_keywords_used_as_fcn_names_issue86.skip.txt |   1 -
 ...keywords_used_as_fcn_names_issue86_expected.txt |   7 +
 .../font_lock_transpose_in_expression_issue87.m    |   5 -
 ...t_lock_transpose_in_expression_issue87.skip.txt |   1 -
 ...ck_transpose_in_expression_issue87_expected.txt |   6 +
 .../font_lock_true_false_enum_issue85.skip.txt     |   1 -
 .../font_lock_true_false_enum_issue85_expected.txt |   9 ++
 ...ont_lock_true_false_fcn_handle_issue90.skip.txt |   1 -
 ...lock_true_false_fcn_handle_issue90_expected.txt |  11 ++
 .../indent_comment_after_prop_expected.m           |   2 +-
 .../indent_old_indents_for_typing.m                |   2 +-
 .../indent_old_indents_for_typing_expected.m       |   4 +-
 .../indent_classdef_abs_methods.m                  |   4 +-
 .../indent_classdef_abs_methods_expected.org       |  42 ++---
 .../indent_xr_classdef1.m                          |   2 +-
 .../indent_xr_classdef1_expected.org               |  62 ++++----
 .../indent_xr_classdef2.m                          |   5 +-
 .../indent_xr_classdef2_expected.org               | 175 +++++++++------------
 .../indent_xr_fun4.m                               |   2 +-
 .../indent_xr_fun4_expected.org                    |  94 +++++------
 .../indent_xr_fun5.m                               |   2 +-
 .../indent_xr_fun5_expected.org                    | 126 +++++++--------
 .../indent_xr_if_cond.m                            |   2 +-
 .../indent_xr_if_cond_expected.org                 | 132 +++++++++-------
 .../indent_xr_switch.m                             |  24 +--
 .../indent_xr_switch_expected.org                  | 168 ++++++++++----------
 .../parser_simple_expected.txt                     |   2 +-
 .../parser_variable_ids_expected.txt               |   2 +-
 .../ts_defun_name_class_expected.txt               |   4 +-
 .../ts_defun_name_fcn_expected.txt                 |   6 +-
 46 files changed, 537 insertions(+), 480 deletions(-)

diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index 50bccf7b93..d2132c79e2 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -796,9 +796,7 @@ Example, disp variable is overriding the disp builtin 
function:
    `(((identifier) @font-lock-builtin-face
       (:pred matlab-ts-mode--is-identifier-builtin @font-lock-builtin-face))
      ((command_name) @font-lock-builtin-face
-      (:pred matlab-ts-mode--is-command-builtin @font-lock-builtin-face))
-     ;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_boolean.m
-     ((boolean) @font-lock-builtin-face))
+      (:pred matlab-ts-mode--is-command-builtin @font-lock-builtin-face)))
 
    ;; F-Rule: namespaces (the +dir's, class methods, etc.)
    ;; See: tests/test-matlab-ts-mode-font-lock-files/font_lock_namespaces.m
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88.skip.txt
deleted file mode 100644
index 240a970c6c..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-see https://github.com/acristoffers/tree-sitter-matlab/issues/88
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88_expected.txt
new file mode 100644
index 0000000000..5664a45ce7
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_cd_dot_dot_issue88_expected.txt
@@ -0,0 +1,6 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+BB aa
+
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.m
similarity index 81%
copy from 
tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m
copy to 
tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.m
index d680acae58..f45add709e 100644
--- a/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.m
@@ -1,11 +1,6 @@
 % -*- matlab-ts -*-
 
 % See: https://github.com/acristoffers/tree-sitter-matlab/issues/84
-foo...
-    = 1;
-bar...
-    = 2;
-
 
 myFcn...
     (1)
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.skip.txt
similarity index 96%
rename from 
tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83.skip.txt
rename to 
tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.skip.txt
index 44072db7cb..c2faf24170 100644
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83.skip.txt
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_fcn_issue84.skip.txt
@@ -1 +1 @@
-See: https://github.com/acristoffers/tree-sitter-matlab/issues/83
+See: https://github.com/acristoffers/tree-sitter-matlab/issues/84
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m
index d680acae58..fcc16007c0 100644
--- a/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m
+++ b/tests/test-matlab-ts-mode-font-lock-files/font_lock_continuation_issue84.m
@@ -5,11 +5,3 @@ foo...
     = 1;
 bar...
     = 2;
-
-
-myFcn...
-    (1)
-
-function myFcn(a)
-    disp(a)
-end
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86.m 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86.m
new file mode 100644
index 0000000000..61e252d36d
--- /dev/null
+++ b/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86.m
@@ -0,0 +1,12 @@
+% -*- matlab-ts -*-
+
+% see https://github.com/acristoffers/tree-sitter-matlab/issues/86
+
+classdef font_lock_end_method_issue86
+    methods
+        function endval = end(obj,k,n) % overload end() for indexing
+            disp('in end')
+            endval=1;
+        end
+    end
+end
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86_expected.txt
new file mode 100644
index 0000000000..030919c001
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_end_method_issue86_expected.txt
@@ -0,0 +1,12 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kkkkkkkk ffffffffffffffffffffffffffff
+    kkkkkkk
+        kkkkkkkk vvvvvv o kkkbvvvDvDvb h hhhhhhhh hhhhh hhh hhhhhhhh
+            BBBBbSss sssSb
+            vvvvvvonD
+        kkk
+    kkk
+kkk
diff --git a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error.m 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error.m
index 3c13a217b5..f5f207a89d 100644
--- a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error.m
+++ b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error.m
@@ -8,7 +8,7 @@ function font_lock_error(foo)
         else
             m = regexp(c, '^[ \t]*\(("[^"]+")[ \t]+\.[ 
\t]+".*\(mFile|pFile|mex\)"\)', tokens)
             if ~isempty(m)
-                out = [out,
+                out = [out, ...
             end
         end
     end
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_expected.txt 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_expected.txt
index 33552c283b..6a4be2d130 100644
--- a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_expected.txt
+++ b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_expected.txt
@@ -1,17 +1,17 @@
-c ccc ccccccccc ccc
-kkkkkkkk fffffffffffffffbvvvb
-    vvv o bSsssSD BBBBBBBbD
+w www wwwwwwwww www
+wwwwwwww wwwwwwwwwwwwwwwwwwww
+    www w wwwwwww wwwwwwwww
 
-    kkk v o nDBBBBBBbdddb
-        v o dddbdbD
-        kk BBBBBBbdD SsssssssssssssssssssssssSD SssssSb
-        kkkk
-            v o BBBBBBbdD Sss EEssssssssssssss EEsssss 
EEsssssssssssssssssssssssssssSD ddddddb
-            kk oBBBBBBBbdb
-                www w wwwww
-            kkk
-        kkk
-    kkk
-kkk
+    www w w wwwwwwwwwwwww
+        w w wwwwwww
+        ww wwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwww wwwwwww
+        wwww
+            w w wwwwwwwww www wwwwwwwwwwwwwwww wwwwwww 
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwww
+            ww wwwwwwwwwww
+                www w wwwww www
+            www
+        www
+    www
+www
 
 
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue51_end_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue51_end_expected.txt
index 12a73893be..2ae1718f7f 100644
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue51_end_expected.txt
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_error_issue51_end_expected.txt
@@ -4,6 +4,6 @@ c ccc 
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 c ccc ccccc cccccc cc cccccccccc cc c cccccccc
 
 kkkkkkkk vvvvvv o fffffffffffffffffffffffffffbvD vb
-    wwwwww w w w wwwwwwww ww w ccc
+    wwwwww w w w wwwwwwww ww w www
 
-kkk
+www
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83_expected.txt
new file mode 100644
index 0000000000..3df2014de8
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_fcn_call_with_expression_issue83_expected.txt
@@ -0,0 +1,14 @@
+c ccc ccccccccc ccc
+
+c cccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+vvvv o bnD nbD
+
+dddddbbddddbnb o ddddbnbb o nnbD
+
+vv o BBBBbbddddbDDdDdboob oo nbD
+BBBbddddddobon nDn nDn onDn nbodddddddddooddddddddddb
+
+kkkkkkkk fffffbvb
+    BBBBbdb
+kkk
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89.skip.txt
deleted file mode 100644
index bb30e16c3b..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-see https://github.com/acristoffers/tree-sitter-matlab/issues/89
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89_expected.txt
new file mode 100644
index 0000000000..4ed0984511
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_for_range_in_parens_issue89_expected.txt
@@ -0,0 +1,7 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kkk bV o nDnb
+    BBBBbBb
+kkk
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
 b/tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.m
similarity index 80%
copy from 
tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
copy to 
tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.m
index 60e21557b0..08e594cd81 100644
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
+++ b/tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.m
@@ -1,10 +1,6 @@
 % -*- matlab-ts -*-
 
-% see https://github.com/acristoffers/tree-sitter-matlab/issues/87
-
-v={1,2};
-myFcn([v' ; {[]}]);
-
+% see https://github.com/acristoffers/tree-sitter-matlab/issues/92
 
 if YL' * sdiff < (eps*norm(HESS,'fro'))
     x = 1;
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.skip.txt
new file mode 100644
index 0000000000..aee427a8a0
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_if_greedness_issue92.skip.txt
@@ -0,0 +1 @@
+see https://github.com/acristoffers/tree-sitter-matlab/issues/92
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86.skip.txt
deleted file mode 100644
index ba029929ab..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-see https://github.com/acristoffers/tree-sitter-matlab/issues/86
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86_expected.txt
new file mode 100644
index 0000000000..bd5d958fc2
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_keywords_used_as_fcn_names_issue86_expected.txt
@@ -0,0 +1,7 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kkkkkkkk v o kkkbvb
+    v o d o nD
+kkk
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
index 60e21557b0..2860eb6844 100644
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.m
@@ -4,8 +4,3 @@
 
 v={1,2};
 myFcn([v' ; {[]}]);
-
-
-if YL' * sdiff < (eps*norm(HESS,'fro'))
-    x = 1;
-end
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.skip.txt
deleted file mode 100644
index 47f6d781f9..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-see https://github.com/acristoffers/tree-sitter-matlab/issues/87
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87_expected.txt
new file mode 100644
index 0000000000..9a6ae485da
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_transpose_in_expression_issue87_expected.txt
@@ -0,0 +1,6 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+vobnDnbD
+dddddbbdo D bbbbbbD
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85.skip.txt
deleted file mode 100644
index f02617b352..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-See https://github.com/acristoffers/tree-sitter-matlab/issues/85
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85_expected.txt
new file mode 100644
index 0000000000..3b92b3b7a9
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_enum_issue85_expected.txt
@@ -0,0 +1,9 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+kkkkkkkk fffffffffffffffffffffffffffffffff
+    kkkkkkkkkkk
+        PPPPPD
+        PPPPD
+    kkk
+kkk
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90.skip.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90.skip.txt
deleted file mode 100644
index a9cca4be86..0000000000
--- 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90.skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-see https://github.com/acristoffers/tree-sitter-matlab/issues/90
diff --git 
a/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90_expected.txt
 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90_expected.txt
new file mode 100644
index 0000000000..712cbf8de1
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-font-lock-files/font_lock_true_false_fcn_handle_issue90_expected.txt
@@ -0,0 +1,11 @@
+c ccc ccccccccc ccc
+
+c ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+kk ddddddddddddd
+    v o oBBBBD
+kkkk
+    v o oBBBBBD
+kkk
+
+dbnb
diff --git 
a/tests/test-matlab-ts-mode-indent-files/indent_comment_after_prop_expected.m 
b/tests/test-matlab-ts-mode-indent-files/indent_comment_after_prop_expected.m
index 2a8d279a0c..45746e5da5 100644
--- 
a/tests/test-matlab-ts-mode-indent-files/indent_comment_after_prop_expected.m
+++ 
b/tests/test-matlab-ts-mode-indent-files/indent_comment_after_prop_expected.m
@@ -58,7 +58,7 @@ classdef indent_comment_after_prop < handle
                         % comment
                       otherwise
                         disp('a > 11');
-                      % comment
+                        % comment
                     end
                     % comment
                 elseif a > 11
diff --git 
a/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing.m 
b/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing.m
index 5227c28d42..40535501c9 100644
--- a/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing.m
+++ b/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing.m
@@ -102,7 +102,7 @@ function B = ends_in_comments_and_strings()
         
         A = E;
         
-    end ... the other end
+    end % the other end
     % !! 4
     
     B = [ B A ]; % !!4
diff --git 
a/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing_expected.m
 
b/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing_expected.m
index 3e7a50d79f..4c23d5e259 100644
--- 
a/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing_expected.m
+++ 
b/tests/test-matlab-ts-mode-indent-files/indent_old_indents_for_typing_expected.m
@@ -102,8 +102,8 @@ function B = ends_in_comments_and_strings()
 
         A = E;
 
-    end ... the other end
-    % !! 4
+    end % the other end
+        % !! 4
 
     B = [ B A ]; % !!4
 
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods.m
index 3d3e35c78a..a1be96004d 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods.m
@@ -1,4 +1,4 @@
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 classdef indent_classdef_abs_methods
     methods(Abstract)
@@ -7,4 +7,4 @@ classdef indent_classdef_abs_methods
     end
 end
 
-%(t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
+% (t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods_expected.org
index 5ec3590f8e..2bc7d97e9e 100644
--- 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods_expected.org
+++ 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_classdef_abs_methods_expected.org
@@ -5,20 +5,20 @@
   (t-utils-xr "C-n" "C-e" "C-m" "C-a" "C-i" "C-a" "C-k" "C-o" "C-i" (insert 
"%comment"))
 
 - Invoking      : "C-n" = next-line
-  Start point   :  177
-  Moved to point:  213
+  Start point   :  218
+  Moved to point:  254
   : 6:35:         [area, desc] = getArea(obj)
   :                                          ^
   No buffer modifications
 
 - Invoking      : "C-e" = move-end-of-line
-  Start point   :  213
+  Start point   :  254
   No point movement
   No buffer modifications
 
 - Invoking      : "C-m" = newline
-  Start point   :  213
-  Moved to point:  222
+  Start point   :  254
+  Moved to point:  263
   : 7:8:         
   :              ^
   Buffer modified:
@@ -36,28 +36,28 @@
   #+end_src diff
 
 - Invoking      : "C-a" = move-beginning-of-line
-  Start point   :  222
-  Moved to point:  214
+  Start point   :  263
+  Moved to point:  255
   : 7:0:         
   :      ^
   No buffer modifications
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  214
-  Moved to point:  222
+  Start point   :  255
+  Moved to point:  263
   : 7:8:         
   :              ^
   No buffer modifications
 
 - Invoking      : "C-a" = move-beginning-of-line
-  Start point   :  222
-  Moved to point:  214
+  Start point   :  263
+  Moved to point:  255
   : 7:0:         
   :      ^
   No buffer modifications
 
 - Invoking      : "C-k" = kill-line
-  Start point   :  214
+  Start point   :  255
   No point movement
   Buffer modified:
   #+begin_src diff
@@ -74,7 +74,7 @@
   #+end_src diff
 
 - Invoking      : "C-o" = open-line
-  Start point   :  214
+  Start point   :  255
   No point movement
   Buffer modified:
   #+begin_src diff
@@ -91,8 +91,8 @@
   #+end_src diff
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  214
-  Moved to point:  222
+  Start point   :  255
+  Moved to point:  263
   : 7:8:         
   :              ^
   Buffer modified:
@@ -111,8 +111,8 @@
   #+end_src diff
 
 - Invoking      : (insert "%comment")
-  Start point   :  222
-  Moved to point:  230
+  Start point   :  263
+  Moved to point:  271
   : 7:16:         %comment
   :                       ^
   Buffer modified:
@@ -130,16 +130,16 @@
  
   #+end_src diff
 
-* Executing commands from indent_classdef_abs_methods.m:11:1:
+* Executing commands from indent_classdef_abs_methods.m:11:2:
 
   (t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
 
 - Invoking      : (t-utils-xr-print-code (point-min) (point-max))
-  Start point   :  305
+  Start point   :  347
   No point movement
   standard-output:
   #+begin_src matlab-ts
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 classdef indent_classdef_abs_methods
     methods(Abstract)
@@ -149,6 +149,6 @@ classdef indent_classdef_abs_methods
     end
 end
 
-%(t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
+% (t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
   #+end_src
   No buffer modifications
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1.m
index d7dfef45e8..9a3f72f8c9 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1.m
@@ -1,4 +1,4 @@
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 %{
   - First row of commands: we validate multiple indents don't cause point 
movement
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1_expected.org
index 1e0662f758..236c8a1258 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef1_expected.org
@@ -14,22 +14,22 @@
   )
 
 - Invoking      : (re-search-forward "^classdef")
-  Start point   :  458
-  Moved to point:  470
+  Start point   :  499
+  Moved to point:  511
   : 18:8: classdef indent_xr_classdef1
   :               ^
   No buffer modifications
 
 - Invoking      : "C-e" = move-end-of-line
-  Start point   :  470
-  Moved to point:  490
+  Start point   :  511
+  Moved to point:  531
   : 18:28: classdef indent_xr_classdef1
   :                                    ^
   No buffer modifications
 
 - Invoking      : "C-m" = newline
-  Start point   :  490
-  Moved to point:  495
+  Start point   :  531
+  Moved to point:  536
   : 19:4:     
   :           ^
   Buffer modified:
@@ -44,18 +44,18 @@
   #+end_src diff
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  495
+  Start point   :  536
   No point movement
   No buffer modifications
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  495
+  Start point   :  536
   No point movement
   No buffer modifications
 
 - Invoking      : (insert "methods")
-  Start point   :  495
-  Moved to point:  502
+  Start point   :  536
+  Moved to point:  543
   : 19:11:     methods
   :                   ^
   Buffer modified:
@@ -71,8 +71,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  502
-  Moved to point:  511
+  Start point   :  543
+  Moved to point:  552
   : 20:8:         
   :               ^
   Buffer modified:
@@ -87,8 +87,8 @@
   #+end_src diff
 
 - Invoking      : (insert "function out=foo")
-  Start point   :  511
-  Moved to point:  527
+  Start point   :  552
+  Moved to point:  568
   : 20:24:         function out=foo
   :                                ^
   Buffer modified:
@@ -104,8 +104,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  527
-  Moved to point:  540
+  Start point   :  568
+  Moved to point:  581
   : 21:12:             
   :                    ^
   Buffer modified:
@@ -120,8 +120,8 @@
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  540
-  Moved to point:  543
+  Start point   :  581
+  Moved to point:  584
   : 21:15:             end
   :                       ^
   Buffer modified:
@@ -137,8 +137,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  543
-  Moved to point:  548
+  Start point   :  584
+  Moved to point:  589
   : 22:8:         
   :               ^
   Buffer modified:
@@ -155,8 +155,8 @@
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  548
-  Moved to point:  551
+  Start point   :  589
+  Moved to point:  592
   : 22:11:         end
   :                   ^
   Buffer modified:
@@ -172,8 +172,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  551
-  Moved to point:  548
+  Start point   :  592
+  Moved to point:  589
   : 23:0: 
   :       ^
   Buffer modified:
@@ -190,8 +190,8 @@
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  548
-  Moved to point:  551
+  Start point   :  589
+  Moved to point:  592
   : 23:3: end
   :          ^
   Buffer modified:
@@ -207,8 +207,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  551
-  Moved to point:  552
+  Start point   :  592
+  Moved to point:  593
   : 24:0: 
   :       ^
   Buffer modified:
@@ -223,14 +223,14 @@
   #+end_src diff
 
 - Invoking      : (re-search-backward "^classdef")
-  Start point   :  552
-  Moved to point:  462
+  Start point   :  593
+  Moved to point:  503
   : 18:0: classdef indent_xr_classdef1
   :       ^
   No buffer modifications
 
 - Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
-  Start point   :  462
+  Start point   :  503
   No point movement
   standard-output:
   #+begin_example
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2.m
index 03ac2b9bbd..bc42315f95 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2.m
@@ -1,4 +1,4 @@
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 %{
 
@@ -13,7 +13,6 @@
   (insert     "end")                        "C-m"
   (insert "end")
   (re-search-backward "^classdef")
-  (print (buffer-substring-no-properties (point) (point-max)))
-  (delete-region (point) (point-max))
+  (t-utils-xr-print-code (point) (point-max))
   )
 %}
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2_expected.org
index 4e22897e28..481fc688a0 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_classdef2_expected.org
@@ -13,35 +13,34 @@
   (insert     "end")                        "C-m"
   (insert "end")
   (re-search-backward "^classdef")
-  (print (buffer-substring-no-properties (point) (point-max)))
-  (delete-region (point) (point-max))
+  (t-utils-xr-print-code (point) (point-max))
   )
 
 - Invoking      : (re-search-forward "%}")
-  Start point   :  596
-  Moved to point:  599
-  : 19:2: %}
+  Start point   :  582
+  Moved to point:  585
+  : 18:2: %}
   :         ^
   No buffer modifications
 
 - Invoking      : "C-n" = next-line
-  Start point   :  599
-  Moved to point:  600
-  : 20:0: 
+  Start point   :  585
+  Moved to point:  586
+  : 19:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : (insert "classdef indent_xr_classdef2")
-  Start point   :  600
-  Moved to point:  628
-  : 20:28: classdef indent_xr_classdef2
+  Start point   :  586
+  Moved to point:  614
+  : 19:28: classdef indent_xr_classdef2
   :                                    ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -17,3 +17,4 @@
-   (delete-region (point) (point-max))
+@@ -16,3 +16,4 @@
+   (t-utils-xr-print-code (point) (point-max))
    )
  %}
 +classdef indent_xr_classdef2
@@ -49,16 +48,16 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  628
-  Moved to point:  633
-  : 21:4:     
+  Start point   :  614
+  Moved to point:  619
+  : 20:4:     
   :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -17,4 +17,5 @@
-   (delete-region (point) (point-max))
+@@ -16,4 +16,5 @@
+   (t-utils-xr-print-code (point) (point-max))
    )
  %}
 -classdef indent_xr_classdef2
@@ -69,15 +68,15 @@
   #+end_src diff
 
 - Invoking      : (insert "properties")
-  Start point   :  633
-  Moved to point:  643
-  : 21:14:     properties
+  Start point   :  619
+  Moved to point:  629
+  : 20:14:     properties
   :                      ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -18,4 +18,4 @@
+@@ -17,4 +17,4 @@
    )
  %}
  classdef indent_xr_classdef2
@@ -88,15 +87,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  643
-  Moved to point:  652
-  : 22:8:         
+  Start point   :  629
+  Moved to point:  638
+  : 21:8:         
   :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -18,4 +18,5 @@
+@@ -17,4 +17,5 @@
    )
  %}
  classdef indent_xr_classdef2
@@ -108,15 +107,15 @@
   #+end_src diff
 
 - Invoking      : (insert "p1")
-  Start point   :  652
-  Moved to point:  654
-  : 22:10:         p1
+  Start point   :  638
+  Moved to point:  640
+  : 21:10:         p1
   :                  ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -19,4 +19,4 @@
+@@ -18,4 +18,4 @@
  %}
  classdef indent_xr_classdef2
      properties
@@ -127,15 +126,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  654
-  Moved to point:  663
-  : 23:8:         
+  Start point   :  640
+  Moved to point:  649
+  : 22:8:         
   :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -19,4 +19,5 @@
+@@ -18,4 +18,5 @@
  %}
  classdef indent_xr_classdef2
      properties
@@ -147,15 +146,15 @@
   #+end_src diff
 
 - Invoking      : (insert "p2 double;")
-  Start point   :  663
-  Moved to point:  673
-  : 23:18:         p2 double;
+  Start point   :  649
+  Moved to point:  659
+  : 22:18:         p2 double;
   :                          ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -20,4 +20,4 @@
+@@ -19,4 +19,4 @@
  classdef indent_xr_classdef2
      properties
          p1
@@ -166,15 +165,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  673
-  Moved to point:  682
-  : 24:8:         
+  Start point   :  659
+  Moved to point:  668
+  : 23:8:         
   :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -20,4 +20,5 @@
+@@ -19,4 +19,5 @@
  classdef indent_xr_classdef2
      properties
          p1
@@ -186,15 +185,15 @@
   #+end_src diff
 
 - Invoking      : (insert "p3continued = ...")
-  Start point   :  682
-  Moved to point:  699
-  : 24:25:         p3continued = ...
+  Start point   :  668
+  Moved to point:  685
+  : 23:25:         p3continued = ...
   :                                 ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -21,4 +21,4 @@
+@@ -20,4 +20,4 @@
      properties
          p1
          p2 double;
@@ -205,15 +204,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  699
-  Moved to point:  712
-  : 25:12:             
+  Start point   :  685
+  Moved to point:  698
+  : 24:12:             
   :                    ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -21,4 +21,5 @@
+@@ -20,4 +20,5 @@
      properties
          p1
          p2 double;
@@ -225,15 +224,15 @@
   #+end_src diff
 
 - Invoking      : (insert "0")
-  Start point   :  712
-  Moved to point:  713
-  : 25:13:             0
+  Start point   :  698
+  Moved to point:  699
+  : 24:13:             0
   :                     ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -22,4 +22,4 @@
+@@ -21,4 +21,4 @@
          p1
          p2 double;
          p3continued = ...
@@ -244,15 +243,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  713
-  Moved to point:  722
-  : 26:8:         
+  Start point   :  699
+  Moved to point:  708
+  : 25:8:         
   :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -22,4 +22,5 @@
+@@ -21,4 +21,5 @@
          p1
          p2 double;
          p3continued = ...
@@ -264,15 +263,15 @@
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  722
-  Moved to point:  725
-  : 26:11:         end
+  Start point   :  708
+  Moved to point:  711
+  : 25:11:         end
   :                   ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -23,4 +23,4 @@
+@@ -22,4 +22,4 @@
          p2 double;
          p3continued = ...
              0
@@ -283,15 +282,15 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  725
-  Moved to point:  722
-  : 27:0: 
+  Start point   :  711
+  Moved to point:  708
+  : 26:0: 
   :       ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -23,4 +23,4 @@
+@@ -22,4 +22,4 @@
          p2 double;
          p3continued = ...
              0
@@ -301,15 +300,15 @@
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  722
-  Moved to point:  725
-  : 27:3: end
+  Start point   :  708
+  Moved to point:  711
+  : 26:3: end
   :          ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -24,3 +24,4 @@
+@@ -23,3 +23,4 @@
          p3continued = ...
              0
      end
@@ -318,17 +317,17 @@
   #+end_src diff
 
 - Invoking      : (re-search-backward "^classdef")
-  Start point   :  725
-  Moved to point:  600
-  : 20:0: classdef indent_xr_classdef2
+  Start point   :  711
+  Moved to point:  586
+  : 19:0: classdef indent_xr_classdef2
   :       ^
   No buffer modifications
 
-- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
-  Start point   :  600
+- Invoking      : (t-utils-xr-print-code (point) (point-max))
+  Start point   :  586
   No point movement
   standard-output:
-  #+begin_example
+  #+begin_src matlab-ts
 classdef indent_xr_classdef2
     properties
         p1
@@ -337,27 +336,5 @@ classdef indent_xr_classdef2
             0
     end
 end
-  #+end_example
+  #+end_src
   No buffer modifications
-
-- Invoking      : (delete-region (point) (point-max))
-  Start point   :  600
-  No point movement
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -17,11 +17,3 @@
-   (delete-region (point) (point-max))
-   )
- %}
--classdef indent_xr_classdef2
--    properties
--        p1
--        p2 double;
--        p3continued = ...
--            0
--    end
--end
-\ No newline at end of file
-  #+end_src diff
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4.m
index e8a8fe0774..10a70aaa74 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4.m
@@ -1,4 +1,4 @@
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 %{
   (t-utils-xr
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4_expected.org
index 4e388a68f6..2a0181585a 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun4_expected.org
@@ -18,23 +18,23 @@
   )
 
 - Invoking      : (re-search-forward "%}")
-  Start point   :  398
-  Moved to point:  401
+  Start point   :  439
+  Moved to point:  442
   : 18:2: %}
   :         ^
   No buffer modifications
 
 - Invoking      : "C-n" = next-line
-  Start point   :  401
-  Moved to point:  402
+  Start point   :  442
+  Moved to point:  443
   : 19:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : (insert "
 ")
-  Start point   :  402
-  Moved to point:  403
+  Start point   :  443
+  Moved to point:  444
   : 20:0: 
   :       ^
   Buffer modified:
@@ -49,15 +49,15 @@
   #+end_src diff
 
 - Invoking      : "C-b" = backward-char
-  Start point   :  403
-  Moved to point:  402
+  Start point   :  444
+  Moved to point:  443
   : 19:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : (insert "function a=indent_xr_fun4")
-  Start point   :  402
-  Moved to point:  427
+  Start point   :  443
+  Moved to point:  468
   : 19:25: function a=indent_xr_fun4
   :                                 ^
   Buffer modified:
@@ -73,8 +73,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  427
-  Moved to point:  432
+  Start point   :  468
+  Moved to point:  473
   : 20:4:     
   :           ^
   Buffer modified:
@@ -89,8 +89,8 @@
   #+end_src diff
 
 - Invoking      : (insert "a=1;")
-  Start point   :  432
-  Moved to point:  436
+  Start point   :  473
+  Moved to point:  477
   : 20:8:     a=1;
   :               ^
   Buffer modified:
@@ -106,10 +106,10 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  436
-  Moved to point:  437
-  : 21:0: 
-  :       ^
+  Start point   :  477
+  Moved to point:  482
+  : 21:4:     
+  :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
@@ -118,14 +118,14 @@
  %}
  function a=indent_xr_fun4
      a=1;
-+
++    
   #+end_src diff
 
 - Invoking      : (insert "%comment")
-  Start point   :  437
-  Moved to point:  445
-  : 21:8: %comment
-  :               ^
+  Start point   :  482
+  Moved to point:  490
+  : 21:12:     %comment
+  :                    ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
@@ -134,33 +134,31 @@
  %}
  function a=indent_xr_fun4
      a=1;
--
-+%comment
+-    
++    %comment
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  445
-  Moved to point:  450
-  : 22:0: 
-  :       ^
+  Start point   :  490
+  Moved to point:  495
+  : 22:4:     
+  :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -18,4 +18,5 @@
- %}
+@@ -19,3 +19,4 @@
  function a=indent_xr_fun4
      a=1;
--%comment
-+    %comment
-+
+     %comment
++    
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  450
-  Moved to point:  453
-  : 22:3: end
-  :          ^
+  Start point   :  495
+  Moved to point:  498
+  : 22:7:     end
+  :              ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
@@ -169,35 +167,37 @@
  function a=indent_xr_fun4
      a=1;
      %comment
--
-+end
+-    
++    end
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  453
-  Moved to point:  454
+  Start point   :  498
+  Moved to point:  495
   : 23:0: 
   :       ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -20,3 +20,4 @@
+@@ -19,4 +19,5 @@
+ function a=indent_xr_fun4
      a=1;
      %comment
- end
+-    end
++end
 +
   #+end_src diff
 
 - Invoking      : (re-search-backward "^fun")
-  Start point   :  454
-  Moved to point:  402
+  Start point   :  495
+  Moved to point:  443
   : 19:0: function a=indent_xr_fun4
   :       ^
   No buffer modifications
 
 - Invoking      : (t-utils-xr-print-code (point) (point-max))
-  Start point   :  402
+  Start point   :  443
   No point movement
   standard-output:
   #+begin_src matlab-ts
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5.m
index e1cec06d79..2b23102d05 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5.m
@@ -1,4 +1,4 @@
-% -*- matlab-ts -*-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
 
 %{
   (t-utils-xr
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5_expected.org
index 3449aa516e..dd6a2af30b 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_fun5_expected.org
@@ -25,23 +25,23 @@
   )
 
 - Invoking      : (re-search-forward "%}")
-  Start point   :  704
-  Moved to point:  707
+  Start point   :  745
+  Moved to point:  748
   : 25:2: %}
   :         ^
   No buffer modifications
 
 - Invoking      : "C-n" = next-line
-  Start point   :  707
-  Moved to point:  708
+  Start point   :  748
+  Moved to point:  749
   : 26:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : (insert "
 ")
-  Start point   :  708
-  Moved to point:  709
+  Start point   :  749
+  Moved to point:  750
   : 27:0: 
   :       ^
   Buffer modified:
@@ -56,15 +56,15 @@
   #+end_src diff
 
 - Invoking      : "C-b" = backward-char
-  Start point   :  709
-  Moved to point:  708
+  Start point   :  750
+  Moved to point:  749
   : 26:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : (insert "function ...")
-  Start point   :  708
-  Moved to point:  720
+  Start point   :  749
+  Moved to point:  761
   : 26:12: function ...
   :                    ^
   Buffer modified:
@@ -80,8 +80,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  720
-  Moved to point:  725
+  Start point   :  761
+  Moved to point:  766
   : 27:4:     
   :           ^
   Buffer modified:
@@ -96,8 +96,8 @@
   #+end_src diff
 
 - Invoking      : (insert "[ ...")
-  Start point   :  725
-  Moved to point:  730
+  Start point   :  766
+  Moved to point:  771
   : 27:9:     [ ...
   :                ^
   Buffer modified:
@@ -113,8 +113,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  730
-  Moved to point:  736
+  Start point   :  771
+  Moved to point:  777
   : 28:5:      
   :            ^
   Buffer modified:
@@ -129,8 +129,8 @@
   #+end_src diff
 
 - Invoking      : (insert "b ... comment for b")
-  Start point   :  736
-  Moved to point:  755
+  Start point   :  777
+  Moved to point:  796
   : 28:24:      b ... comment for b
   :                                ^
   Buffer modified:
@@ -146,8 +146,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  755
-  Moved to point:  761
+  Start point   :  796
+  Moved to point:  802
   : 29:5:      
   :            ^
   Buffer modified:
@@ -162,8 +162,8 @@
   #+end_src diff
 
 - Invoking      : (insert "] = ...")
-  Start point   :  761
-  Moved to point:  768
+  Start point   :  802
+  Moved to point:  809
   : 29:12:      ] = ...
   :                    ^
   Buffer modified:
@@ -179,8 +179,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  768
-  Moved to point:  772
+  Start point   :  809
+  Moved to point:  813
   : 30:4:     
   :           ^
   Buffer modified:
@@ -197,8 +197,8 @@
   #+end_src diff
 
 - Invoking      : (insert "indent_xr_fun5 ...")
-  Start point   :  772
-  Moved to point:  790
+  Start point   :  813
+  Moved to point:  831
   : 30:22:     indent_xr_fun5 ...
   :                              ^
   Buffer modified:
@@ -214,8 +214,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  790
-  Moved to point:  791
+  Start point   :  831
+  Moved to point:  832
   : 31:0: 
   :       ^
   Buffer modified:
@@ -230,8 +230,8 @@
   #+end_src diff
 
 - Invoking      : (insert "( ...")
-  Start point   :  791
-  Moved to point:  796
+  Start point   :  832
+  Moved to point:  837
   : 31:5: ( ...
   :            ^
   Buffer modified:
@@ -247,8 +247,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  796
-  Moved to point:  806
+  Start point   :  837
+  Moved to point:  847
   : 32:5:      
   :            ^
   Buffer modified:
@@ -265,8 +265,8 @@
   #+end_src diff
 
 - Invoking      : (insert "a ... comment for a")
-  Start point   :  806
-  Moved to point:  825
+  Start point   :  847
+  Moved to point:  866
   : 32:24:      a ... comment for a
   :                                ^
   Buffer modified:
@@ -282,8 +282,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  825
-  Moved to point:  831
+  Start point   :  866
+  Moved to point:  872
   : 33:5:      
   :            ^
   Buffer modified:
@@ -298,8 +298,8 @@
   #+end_src diff
 
 - Invoking      : (insert ")")
-  Start point   :  831
-  Moved to point:  832
+  Start point   :  872
+  Moved to point:  873
   : 33:6:      )
   :             ^
   Buffer modified:
@@ -315,8 +315,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  832
-  Moved to point:  836
+  Start point   :  873
+  Moved to point:  877
   : 34:4:     
   :           ^
   Buffer modified:
@@ -333,8 +333,8 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  836
-  Moved to point:  837
+  Start point   :  877
+  Moved to point:  878
   : 35:4:     
   :           ^
   Buffer modified:
@@ -350,8 +350,8 @@
   #+end_src diff
 
 - Invoking      : (insert "b=2*a;")
-  Start point   :  837
-  Moved to point:  843
+  Start point   :  878
+  Moved to point:  884
   : 35:10:     b=2*a;
   :                  ^
   Buffer modified:
@@ -367,10 +367,10 @@
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  843
-  Moved to point:  844
-  : 36:0: 
-  :       ^
+  Start point   :  884
+  Moved to point:  889
+  : 36:4:     
+  :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
@@ -379,14 +379,14 @@
      )
  
      b=2*a;
-+
++    
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  844
-  Moved to point:  847
-  : 36:3: end
-  :          ^
+  Start point   :  889
+  Moved to point:  892
+  : 36:7:     end
+  :              ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
@@ -395,35 +395,37 @@
      )
  
      b=2*a;
--
-+end
+-    
++    end
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  847
-  Moved to point:  848
+  Start point   :  892
+  Moved to point:  889
   : 37:0: 
   :       ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -34,3 +34,4 @@
+@@ -33,4 +33,5 @@
+     )
  
      b=2*a;
- end
+-    end
++end
 +
   #+end_src diff
 
 - Invoking      : (re-search-backward "^fun")
-  Start point   :  848
-  Moved to point:  708
+  Start point   :  889
+  Moved to point:  749
   : 26:0: function ...
   :       ^
   No buffer modifications
 
 - Invoking      : (t-utils-xr-print-code (point) (point-max))
-  Start point   :  708
+  Start point   :  749
   No point movement
   standard-output:
   #+begin_src matlab-ts
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond.m
index 859088d4df..181cf19143 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond.m
@@ -2,7 +2,7 @@
 
 function indent_xr_if_cond(a, b)
 
-    % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1"))
+    % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1") "C-m")
     if a > 1 && ...
     end
 
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond_expected.org
index 554b0d0d31..9b77e46c33 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_if_cond_expected.org
@@ -2,87 +2,108 @@
 
 * Executing commands from indent_xr_if_cond.m:5:6:
 
-  (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1"))
+  (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1") "C-m")
 
 - Invoking      : "C-n" = next-line
-  Start point   :  109
-  Moved to point:  129
+  Start point   :  115
+  Moved to point:  135
   : 6:19:     if a > 1 && ...
   :                          ^
   No buffer modifications
 
 - Invoking      : "C-e" = move-end-of-line
-  Start point   :  129
+  Start point   :  135
   No point movement
   No buffer modifications
 
 - Invoking      : "C-m" = newline
-  Start point   :  129
-  Moved to point:  137
-  : 7:7:        
-  :             ^
+  Start point   :  135
+  Moved to point:  153
+  : 7:17:                  
+  :                        ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
 @@ -4,6 +4,7 @@
  
-     % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1"))
+     % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1") "C-m")
      if a > 1 && ...
-+       
++                 
      end
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
   #+end_src diff
 
 - Invoking      : (insert "b > 1")
-  Start point   :  137
-  Moved to point:  142
-  : 7:12:        b > 1
-  :                   ^
+  Start point   :  153
+  Moved to point:  158
+  : 7:22:                  b > 1
+  :                             ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
 @@ -4,7 +4,7 @@
  
-     % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1"))
+     % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1") "C-m")
+     if a > 1 && ...
+-                 
++                 b > 1
+     end
+ 
+     % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
+  #+end_src diff
+
+- Invoking      : "C-m" = newline
+  Start point   :  158
+  Moved to point:  157
+  : 8:8:         
+  :              ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -4,7 +4,8 @@
+ 
+     % (t-utils-xr "C-n" "C-e" "C-m" (insert "b > 1") "C-m")
      if a > 1 && ...
--       
+-                 b > 1
 +       b > 1
++        
      end
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
   #+end_src diff
 
-* Executing commands from indent_xr_if_cond.m:10:6:
+* Executing commands from indent_xr_if_cond.m:11:6:
 
   (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
 
 - Invoking      : "C-n" = next-line
-  Start point   :  205
-  Moved to point:  229
-  : 11:23:     switch a > 1 && ...
+  Start point   :  220
+  Moved to point:  244
+  : 12:23:     switch a > 1 && ...
   :                               ^
   No buffer modifications
 
 - Invoking      : "C-n" = next-line
-  Start point   :  229
-  Moved to point:  230
-  : 12:0: 
+  Start point   :  244
+  Moved to point:  245
+  : 13:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  230
-  Moved to point:  241
-  : 12:11:            
+  Start point   :  245
+  Moved to point:  256
+  : 13:11:            
   :                   ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -9,7 +9,7 @@
+@@ -10,7 +10,7 @@
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
      switch a > 1 && ...
@@ -94,15 +115,15 @@
   #+end_src diff
 
 - Invoking      : (insert "b > 1")
-  Start point   :  241
-  Moved to point:  246
-  : 12:16:            b > 1
+  Start point   :  256
+  Moved to point:  261
+  : 13:16:            b > 1
   :                        ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -9,7 +9,7 @@
+@@ -10,7 +10,7 @@
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
      switch a > 1 && ...
@@ -113,70 +134,70 @@
      end
   #+end_src diff
 
-* Executing commands from indent_xr_if_cond.m:17:6:
+* Executing commands from indent_xr_if_cond.m:18:6:
 
   (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
 
 - Invoking      : "C-n" = next-line
-  Start point   :  342
-  Moved to point:  365
-  : 18:22:     while a > 1 && ...
+  Start point   :  357
+  Moved to point:  380
+  : 19:22:     while a > 1 && ...
   :                              ^
   No buffer modifications
 
 - Invoking      : "C-n" = next-line
-  Start point   :  365
-  Moved to point:  366
-  : 19:0: 
+  Start point   :  380
+  Moved to point:  381
+  : 20:0: 
   :       ^
   No buffer modifications
 
 - Invoking      : "C-i" = indent-for-tab-command
-  Start point   :  366
-  Moved to point:  376
-  : 19:10:           
-  :                  ^
+  Start point   :  381
+  Moved to point:  389
+  : 20:8:         
+  :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -16,7 +16,7 @@
+@@ -17,7 +17,7 @@
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
      while a > 1 && ...
 -
-+          
++        
      end
  
  end
   #+end_src diff
 
 - Invoking      : (insert "b > 1")
-  Start point   :  376
-  Moved to point:  381
-  : 19:15:           b > 1
-  :                       ^
+  Start point   :  389
+  Moved to point:  394
+  : 20:13:         b > 1
+  :                     ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -16,7 +16,7 @@
+@@ -17,7 +17,7 @@
  
      % (t-utils-xr "C-n" "C-n" "C-i" (insert "b > 1"))
      while a > 1 && ...
--          
-+          b > 1
+-        
++        b > 1
      end
  
  end
   #+end_src diff
 
-* Executing commands from indent_xr_if_cond.m:24:2:
+* Executing commands from indent_xr_if_cond.m:25:2:
 
   (t-utils-xr (t-utils-xr-print-code (point-min) (point-max)))
 
 - Invoking      : (t-utils-xr-print-code (point-min) (point-max))
-  Start point   :  458
+  Start point   :  471
   No point movement
   standard-output:
   #+begin_src matlab-ts
@@ -184,9 +205,10 @@
 
 function indent_xr_if_cond(a, b)
 
-    % (t-utils-xr \"C-n\" \"C-e\" \"C-m\" (insert \"b > 1\"))
+    % (t-utils-xr \"C-n\" \"C-e\" \"C-m\" (insert \"b > 1\") \"C-m\")
     if a > 1 && ...
        b > 1
+        
     end
 
     % (t-utils-xr \"C-n\" \"C-n\" \"C-i\" (insert \"b > 1\"))
@@ -198,7 +220,7 @@ function indent_xr_if_cond(a, b)
 
     % (t-utils-xr \"C-n\" \"C-n\" \"C-i\" (insert \"b > 1\"))
     while a > 1 && ...
-          b > 1
+        b > 1
     end
 
 end
diff --git a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch.m
index c4b0a5a8a1..38c1a329f6 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch.m
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch.m
@@ -1,16 +1,16 @@
-% -*- matlab-ts -*-
-% (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
-switch fcn1(a)
-
-
-  
-
-
-  
-    
-
-
+% -*- mode: matlab-ts; matlab-ts-mode-electric-ends: nil -*-
+%{
 
+  (t-utils-xr
 
+  (re-search-forward "^switch")  "C-e" "C-m"
+  (insert "case 1")                    "C-m"
+  (insert "disp('1');")                "C-m"
+  (insert "end")                       "C-m"
 
+  (re-search-backward "^switch")
+  (t-utils-xr-print-code (point) (point-max))
 
+  )
+%}
+switch fcn1(a)
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch_expected.org 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch_expected.org
index 1dd3bd4aef..65104adac9 100644
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch_expected.org
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_switch_expected.org
@@ -1,164 +1,166 @@
 #+startup: showall
 
-* Executing commands from indent_xr_switch.m:2:2:
+* Executing commands from indent_xr_switch.m:4:2:
 
-  (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
+  (t-utils-xr
 
-- Invoking      : "C-a" = move-beginning-of-line
-  Start point   :  132
-  Moved to point:   21
-  : 2:0: % (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
-  :      ^
-  No buffer modifications
+  (re-search-forward "^switch")  "C-e" "C-m"
+  (insert "case 1")                    "C-m"
+  (insert "disp('1');")                "C-m"
+  (insert "end")                       "C-m"
+
+  (re-search-backward "^switch")
+  (t-utils-xr-print-code (point) (point-max))
+
+  )
 
-- Invoking      : "C-n" = next-line
-  Start point   :   21
-  Moved to point:  133
-  : 3:0: switch fcn1(a)
-  :      ^
+- Invoking      : (re-search-forward "^switch")
+  Start point   :  345
+  Moved to point:  355
+  : 16:6: switch fcn1(a)
+  :             ^
   No buffer modifications
 
 - Invoking      : "C-e" = move-end-of-line
-  Start point   :  133
-  Moved to point:  147
-  : 3:14: switch fcn1(a)
-  :                     ^
+  Start point   :  355
+  Moved to point:  363
+  : 16:14: switch fcn1(a)
+  :                      ^
   No buffer modifications
 
 - Invoking      : "C-m" = newline
-  Start point   :  147
-  Moved to point:  150
-  : 4:2:   
-  :        ^
+  Start point   :  363
+  Moved to point:  366
+  : 17:2:   
+  :         ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -1,6 +1,7 @@
- % -*- matlab-ts -*-
- % (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
+@@ -14,3 +14,4 @@
+   )
+ %}
  switch fcn1(a)
 +  
- 
- 
-   
   #+end_src diff
 
 - Invoking      : (insert "case 1")
-  Start point   :  150
-  Moved to point:  156
-  : 4:8:   case 1
-  :              ^
+  Start point   :  366
+  Moved to point:  372
+  : 17:8:   case 1
+  :               ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -1,7 +1,7 @@
- % -*- matlab-ts -*-
- % (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
+@@ -14,4 +14,4 @@
+   )
+ %}
  switch fcn1(a)
 -  
 +  case 1
- 
- 
-   
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  156
-  Moved to point:  161
-  : 5:4:     
-  :          ^
+  Start point   :  372
+  Moved to point:  377
+  : 18:4:     
+  :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -2,6 +2,7 @@
- % (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
+@@ -15,3 +15,4 @@
+ %}
  switch fcn1(a)
    case 1
 +    
- 
- 
-   
   #+end_src diff
 
 - Invoking      : (insert "disp('1');")
-  Start point   :  161
-  Moved to point:  171
-  : 5:14:     disp('1');
-  :                     ^
+  Start point   :  377
+  Moved to point:  387
+  : 18:14:     disp('1');
+  :                      ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -2,7 +2,7 @@
- % (t-utils-xr "C-a" "C-n" "C-e" "C-m" (insert "case 1") "C-m" (insert 
"disp('1');") "C-m" (insert "end") "C-m")
+@@ -15,4 +15,4 @@
+ %}
  switch fcn1(a)
    case 1
 -    
 +    disp('1');
- 
- 
-   
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  171
-  Moved to point:  174
-  : 6:2:   
-  :        ^
+  Start point   :  387
+  Moved to point:  392
+  : 19:4:     
+  :           ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -3,6 +3,7 @@
+@@ -16,3 +16,4 @@
  switch fcn1(a)
    case 1
      disp('1');
-+  
- 
- 
-   
++    
   #+end_src diff
 
 - Invoking      : (insert "end")
-  Start point   :  174
-  Moved to point:  177
-  : 6:5:   end
-  :           ^
+  Start point   :  392
+  Moved to point:  395
+  : 19:7:     end
+  :              ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -3,7 +3,7 @@
+@@ -16,4 +16,4 @@
  switch fcn1(a)
    case 1
      disp('1');
--  
-+  end
- 
- 
-   
+-    
++    end
   #+end_src diff
 
 - Invoking      : "C-m" = newline
-  Start point   :  177
-  Moved to point:  176
-  : 7:0: 
-  :      ^
+  Start point   :  395
+  Moved to point:  392
+  : 20:0: 
+  :       ^
   Buffer modified:
   #+begin_src diff
 --- start_contents
 +++ end_contents
-@@ -3,7 +3,8 @@
+@@ -16,4 +16,5 @@
  switch fcn1(a)
    case 1
      disp('1');
--  end
+-    end
 +end
 +
- 
- 
-   
   #+end_src diff
+
+- Invoking      : (re-search-backward "^switch")
+  Start point   :  392
+  Moved to point:  349
+  : 16:0: switch fcn1(a)
+  :       ^
+  No buffer modifications
+
+- Invoking      : (t-utils-xr-print-code (point) (point-max))
+  Start point   :  349
+  No point movement
+  standard-output:
+  #+begin_src matlab-ts
+switch fcn1(a)
+  case 1
+    disp('1');
+end
+
+  #+end_src
+  No buffer modifications
diff --git a/tests/test-matlab-ts-mode-parser-files/parser_simple_expected.txt 
b/tests/test-matlab-ts-mode-parser-files/parser_simple_expected.txt
index 17e74b1e4d..58734b41ce 100644
--- a/tests/test-matlab-ts-mode-parser-files/parser_simple_expected.txt
+++ b/tests/test-matlab-ts-mode-parser-files/parser_simple_expected.txt
@@ -2,4 +2,4 @@
 (source_file (comment[1,20]{% -*- matlab-ts -*-})
  (assignment left: (identifier[22,23]{a}) =
   right: (binary_operator left: (number[26,27]{1}) + right: 
(number[30,31]{2})))
- ;)
+ ; \n)
diff --git 
a/tests/test-matlab-ts-mode-parser-files/parser_variable_ids_expected.txt 
b/tests/test-matlab-ts-mode-parser-files/parser_variable_ids_expected.txt
index 2260f6c9fe..1b0e9a5381 100644
--- a/tests/test-matlab-ts-mode-parser-files/parser_variable_ids_expected.txt
+++ b/tests/test-matlab-ts-mode-parser-files/parser_variable_ids_expected.txt
@@ -17,6 +17,6 @@
     right: 
      (binary_operator left: (identifier[106,110]{out1}) +
       right: (binary_operator left: (number[113,114]{2}) * right: 
(identifier[117,121]{out1}))))
-   ;)
+   ; \n)
   end)
  \n)
diff --git 
a/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_class_expected.txt
 
b/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_class_expected.txt
index b2853e28de..99bbcd76e5 100644
--- 
a/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_class_expected.txt
+++ 
b/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_class_expected.txt
@@ -14,7 +14,7 @@ Node                identifier at  132 to  133: defun-name = 
nil
 Node                identifier at  136 to  144: defun-name = nil
 Node        function_arguments at  144 to  149: defun-name = nil
 Node                identifier at  145 to  148: defun-name = nil
-Node                     block at  162 to  188: defun-name = nil
+Node                     block at  162 to  189: defun-name = nil
 Node                assignment at  162 to  187: defun-name = nil
 Node                identifier at  162 to  163: defun-name = nil
 Node             function_call at  166 to  187: defun-name = nil
@@ -33,7 +33,7 @@ Node                identifier at  222 to  232: defun-name = 
nil
 Node        function_arguments at  232 to  240: defun-name = nil
 Node                identifier at  233 to  236: defun-name = nil
 Node                identifier at  238 to  239: defun-name = nil
-Node                     block at  253 to  273: defun-name = nil
+Node                     block at  253 to  274: defun-name = nil
 Node                assignment at  253 to  272: defun-name = nil
 Node                identifier at  253 to  254: defun-name = nil
 Node           binary_operator at  257 to  272: defun-name = nil
diff --git 
a/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_fcn_expected.txt
 
b/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_fcn_expected.txt
index 31739fb6b3..dbdf83b607 100644
--- 
a/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_fcn_expected.txt
+++ 
b/tests/test-matlab-ts-mode-treesit-defun-name-files/ts_defun_name_fcn_expected.txt
@@ -27,9 +27,9 @@ Node                    string at  114 to  119: defun-name = 
nil
 Node            string_content at  115 to  118: defun-name = nil
 Node          switch_statement at  133 to  238: defun-name = nil
 Node                identifier at  140 to  141: defun-name = nil
-Node               case_clause at  156 to  222: defun-name = nil
+Node               case_clause at  156 to  223: defun-name = nil
 Node                    number at  161 to  162: defun-name = nil
-Node                     block at  179 to  222: defun-name = nil
+Node                     block at  179 to  223: defun-name = nil
 Node             function_call at  179 to  193: defun-name = nil
 Node                identifier at  179 to  183: defun-name = nil
 Node                 arguments at  184 to  192: defun-name = nil
@@ -62,7 +62,7 @@ Node                identifier at  320 to  321: defun-name = 
nil
 Node                identifier at  324 to  328: defun-name = nil
 Node        function_arguments at  328 to  331: defun-name = nil
 Node                identifier at  329 to  330: defun-name = nil
-Node                     block at  340 to  350: defun-name = nil
+Node                     block at  340 to  351: defun-name = nil
 Node                assignment at  340 to  349: defun-name = nil
 Node                identifier at  340 to  341: defun-name = nil
 Node           binary_operator at  344 to  349: defun-name = nil

Reply via email to