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

    matlab-ts-mode: add test for incomplete continuation
---
 matlab-ts-mode.el                                  |   9 +-
 .../indent_xr_continuation1.m                      |   4 -
 .../indent_xr_continuation1_expected.org           | 115 -------------------
 .../indent_xr_continuation2.m                      |   4 -
 .../indent_xr_continuation2_expected.org           |  97 ----------------
 .../indent_xr_i_cont_incomplete1.m                 |   4 +
 .../indent_xr_i_cont_incomplete1_expected.org      | 123 +++++++++++++++++++++
 .../indent_xr_i_cont_incomplete2.m                 |   4 +
 .../indent_xr_i_cont_incomplete2_expected.org      | 105 ++++++++++++++++++
 .../indent_xr_i_cont_incomplete3.m                 |   4 +
 .../indent_xr_i_cont_incomplete3_expected.org      | 105 ++++++++++++++++++
 11 files changed, 346 insertions(+), 228 deletions(-)

diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index 7f0c71397c..f1a484cea4 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -1408,7 +1408,7 @@ is where we start looking for the error node."
      ;;
      ;;            myVariable = 1 + myfcn(a, b) + ...
      ;;                ^                                 <== TAB or RET on 
prior line goes here
-     ;; See: 
tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation*.m
+     ;; See: 
tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete*.m
      (,#'matlab-ts-mode--i-cont-incomplete-matcher
       ,#'matlab-ts-mode--i-cont-incomplete-anchor
       ,#'matlab-ts-mode--i-cont-incomplete-offset)
@@ -1420,7 +1420,6 @@ is where we start looking for the error node."
 
 ;;; Thing settings for movement, etc.
 
-
 ;; TODO should we use following for M-a, M-e?
 ;; This needs tune up, but could workout better than using 
matlab-ts-mode--thing-settings
 ;;
@@ -2067,12 +2066,6 @@ is t, add the following to an Init File (e.g. 
`user-init-file' or
     ;; TODO update --indent-rules to have "See: test file" comments.
     ;;
     ;; TODO indent
-    ;;      function a=foo
-    ;;          a = ...
-    ;;              ^              <== RET on previous line or TAB should be 
here
-    ;;      end
-    ;;
-    ;; TODO indent
     ;;          outResult = longFunction(...
     ;;              ^              <== RET on previous line or TAB should be 
here
     ;;
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1.m
deleted file mode 100644
index ca6054dc59..0000000000
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1.m
+++ /dev/null
@@ -1,4 +0,0 @@
-% -*- matlab-ts -*-
-function result = indent_xr_continuation1(a, b)
-% (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-end
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1_expected.org
deleted file mode 100644
index c51878e939..0000000000
--- 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation1_expected.org
+++ /dev/null
@@ -1,115 +0,0 @@
-#+startup: showall
-
-* Executing commands from indent_xr_continuation1.m:3:2:
-
-  (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-
-- Invoking      : "C-e" = move-end-of-line
-  Start point   :  255
-  No point movement
-  No buffer modifications
-
-- Invoking      : "C-m" = newline
-  Start point   :  255
-  Moved to point:  260
-  : 4:4:     
-  :          ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -1,4 +1,5 @@
- % -*- matlab-ts -*-
- function result = indent_xr_continuation1(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-+    
- end
-  #+end_src diff
-
-- Invoking      : (insert "result = 1 + myfcn(a, ...")
-  Start point   :  260
-  Moved to point:  285
-  : 4:29:     result = 1 + myfcn(a, ...
-  :                                    ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -1,5 +1,5 @@
- % -*- matlab-ts -*-
- function result = indent_xr_continuation1(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
--    
-+    result = 1 + myfcn(a, ...
- end
-  #+end_src diff
-
-- Invoking      : "C-m" = newline
-  Start point   :  285
-  Moved to point:  309
-  : 5:23:                        
-  :                              ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -2,4 +2,5 @@
- function result = indent_xr_continuation1(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-     result = 1 + myfcn(a, ...
-+                       
- end
-  #+end_src diff
-
-- Invoking      : (insert "b);")
-  Start point   :  309
-  Moved to point:  312
-  : 5:26:                        b);
-  :                                 ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -2,5 +2,5 @@
- function result = indent_xr_continuation1(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-     result = 1 + myfcn(a, ...
--                       
-+                       b);
- end
-  #+end_src diff
-
-- Invoking      : "C-m" = newline
-  Start point   :  312
-  Moved to point:  317
-  : 6:4:     
-  :          ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -3,4 +3,5 @@
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" (insert 
"b);") "C-m" (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-     result = 1 + myfcn(a, ...
-                        b);
-+    
- end
-  #+end_src diff
-
-- Invoking      : (re-search-backward "^[ ]*result")
-  Start point   :  317
-  Moved to point:  256
-  : 4:0:     result = 1 + myfcn(a, ...
-  :      ^
-  No buffer modifications
-
-- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
-  Start point   :  256
-  No point movement
-  standard-output:
-    "    result = 1 + myfcn(a, ...
-                         b);
-      
-  end
-  "
-  No buffer modifications
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2.m
deleted file mode 100644
index e974e88fe4..0000000000
--- a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2.m
+++ /dev/null
@@ -1,4 +0,0 @@
-% -*- matlab-ts -*-
-function result = indent_xr_continuation2(a, b)
-% (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-end
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2_expected.org
deleted file mode 100644
index 0bceb12b37..0000000000
--- 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_continuation2_expected.org
+++ /dev/null
@@ -1,97 +0,0 @@
-#+startup: showall
-
-* Executing commands from indent_xr_continuation2.m:3:2:
-
-  (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-
-- Invoking      : "C-e" = move-end-of-line
-  Start point   :  254
-  No point movement
-  No buffer modifications
-
-- Invoking      : "C-m" = newline
-  Start point   :  254
-  Moved to point:  259
-  : 4:4:     
-  :          ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -1,4 +1,5 @@
- % -*- matlab-ts -*-
- function result = indent_xr_continuation2(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-+    
- end
-  #+end_src diff
-
-- Invoking      : (insert "result = 1 + myfcn(a, b) + ...")
-  Start point   :  259
-  Moved to point:  289
-  : 4:34:     result = 1 + myfcn(a, b) + ...
-  :                                         ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -1,5 +1,5 @@
- % -*- matlab-ts -*-
- function result = indent_xr_continuation2(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
--    
-+    result = 1 + myfcn(a, b) + ...
- end
-  #+end_src diff
-
-- Invoking      : "C-m" = newline
-  Start point   :  289
-  Moved to point:  298
-  : 5:8:         
-  :              ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -2,4 +2,5 @@
- function result = indent_xr_continuation2(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-     result = 1 + myfcn(a, b) + ...
-+        
- end
-  #+end_src diff
-
-- Invoking      : (insert "b);")
-  Start point   :  298
-  Moved to point:  301
-  : 5:11:         b);
-  :                  ^
-  Buffer modified:
-  #+begin_src diff
---- start_contents
-+++ end_contents
-@@ -2,5 +2,5 @@
- function result = indent_xr_continuation2(a, b)
- % (t-utils-xr "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") "C-m" 
(insert "b);") (re-search-backward "^[ ]*result") (print 
(buffer-substring-no-properties (point) (point-max))))
-     result = 1 + myfcn(a, b) + ...
--        
-+        b);
- end
-  #+end_src diff
-
-- Invoking      : (re-search-backward "^[ ]*result")
-  Start point   :  301
-  Moved to point:  255
-  : 4:0:     result = 1 + myfcn(a, b) + ...
-  :      ^
-  No buffer modifications
-
-- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
-  Start point   :  255
-  No point movement
-  standard-output:
-    "    result = 1 + myfcn(a, b) + ...
-          b);
-  end
-  "
-  No buffer modifications
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1.m
new file mode 100644
index 0000000000..5e645d0a5e
--- /dev/null
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1.m
@@ -0,0 +1,4 @@
+% -*- matlab-ts -*-
+% (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+function result = indent_xr_i_cont_incomplete1(a, b)
+end
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1_expected.org
new file mode 100644
index 0000000000..3dca4af16f
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete1_expected.org
@@ -0,0 +1,123 @@
+#+startup: showall
+
+* Executing commands from indent_xr_i_cont_incomplete1.m:2:2:
+
+  (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+
+- Invoking      : "C-n" = next-line
+  Start point   :  206
+  Moved to point:  259
+  : 3:52: function result = indent_xr_i_cont_incomplete1(a, b)
+  :                                                           ^
+  No buffer modifications
+
+- Invoking      : "C-e" = move-end-of-line
+  Start point   :  259
+  No point movement
+  No buffer modifications
+
+- Invoking      : "C-m" = newline
+  Start point   :  259
+  Moved to point:  264
+  : 4:4:     
+  :          ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,4 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete1(a, b)
++    
+ end
+  #+end_src diff
+
+- Invoking      : (insert "result = 1 + myfcn(a, ...")
+  Start point   :  264
+  Moved to point:  289
+  : 4:29:     result = 1 + myfcn(a, ...
+  :                                    ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,5 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete1(a, b)
+-    
++    result = 1 + myfcn(a, ...
+ end
+  #+end_src diff
+
+- Invoking      : "C-m" = newline
+  Start point   :  289
+  Moved to point:  313
+  : 5:23:                        
+  :                              ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,4 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete1(a, b)
+     result = 1 + myfcn(a, ...
++                       
+ end
+  #+end_src diff
+
+- Invoking      : (insert "b);")
+  Start point   :  313
+  Moved to point:  316
+  : 5:26:                        b);
+  :                                 ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,5 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, ...") "C-m" 
(insert "b);") "C-m" (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete1(a, b)
+     result = 1 + myfcn(a, ...
+-                       
++                       b);
+ end
+  #+end_src diff
+
+- Invoking      : "C-m" = newline
+  Start point   :  316
+  Moved to point:  321
+  : 6:4:     
+  :          ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -3,4 +3,5 @@
+ function result = indent_xr_i_cont_incomplete1(a, b)
+     result = 1 + myfcn(a, ...
+                        b);
++    
+ end
+  #+end_src diff
+
+- Invoking      : (re-search-backward "^fun")
+  Start point   :  321
+  Moved to point:  207
+  : 3:0: function result = indent_xr_i_cont_incomplete1(a, b)
+  :      ^
+  No buffer modifications
+
+- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
+  Start point   :  207
+  No point movement
+  standard-output:
+    "function result = indent_xr_i_cont_incomplete1(a, b)
+      result = 1 + myfcn(a, ...
+                         b);
+      
+  end
+  "
+  No buffer modifications
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2.m
new file mode 100644
index 0000000000..37b2db853e
--- /dev/null
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2.m
@@ -0,0 +1,4 @@
+% -*- matlab-ts -*-
+% (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+function result = indent_xr_i_cont_incomplete2(a, b)
+end
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2_expected.org
new file mode 100644
index 0000000000..260c1ead9f
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete2_expected.org
@@ -0,0 +1,105 @@
+#+startup: showall
+
+* Executing commands from indent_xr_i_cont_incomplete2.m:2:2:
+
+  (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+
+- Invoking      : "C-n" = next-line
+  Start point   :  205
+  Moved to point:  258
+  : 3:52: function result = indent_xr_i_cont_incomplete2(a, b)
+  :                                                           ^
+  No buffer modifications
+
+- Invoking      : "C-e" = move-end-of-line
+  Start point   :  258
+  No point movement
+  No buffer modifications
+
+- Invoking      : "C-m" = newline
+  Start point   :  258
+  Moved to point:  263
+  : 4:4:     
+  :          ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,4 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete2(a, b)
++    
+ end
+  #+end_src diff
+
+- Invoking      : (insert "result = 1 + myfcn(a, b) + ...")
+  Start point   :  263
+  Moved to point:  293
+  : 4:34:     result = 1 + myfcn(a, b) + ...
+  :                                         ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,5 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete2(a, b)
+-    
++    result = 1 + myfcn(a, b) + ...
+ end
+  #+end_src diff
+
+- Invoking      : "C-m" = newline
+  Start point   :  293
+  Moved to point:  302
+  : 5:8:         
+  :              ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,4 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete2(a, b)
+     result = 1 + myfcn(a, b) + ...
++        
+ end
+  #+end_src diff
+
+- Invoking      : (insert "b);")
+  Start point   :  302
+  Moved to point:  305
+  : 5:11:         b);
+  :                  ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,5 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "result = 1 + myfcn(a, b) + ...") 
"C-m" (insert "b);") (re-search-backward "^fun") (print 
(buffer-substring-no-properties (point) (point-max))))
+ function result = indent_xr_i_cont_incomplete2(a, b)
+     result = 1 + myfcn(a, b) + ...
+-        
++        b);
+ end
+  #+end_src diff
+
+- Invoking      : (re-search-backward "^fun")
+  Start point   :  305
+  Moved to point:  206
+  : 3:0: function result = indent_xr_i_cont_incomplete2(a, b)
+  :      ^
+  No buffer modifications
+
+- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
+  Start point   :  206
+  No point movement
+  standard-output:
+    "function result = indent_xr_i_cont_incomplete2(a, b)
+      result = 1 + myfcn(a, b) + ...
+          b);
+  end
+  "
+  No buffer modifications
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3.m 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3.m
new file mode 100644
index 0000000000..6c39ef5632
--- /dev/null
+++ b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3.m
@@ -0,0 +1,4 @@
+% -*- matlab-ts -*-
+% (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+function a = indent_xr_i_cont_incomplete1
+end
diff --git 
a/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3_expected.org
 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3_expected.org
new file mode 100644
index 0000000000..ab37755c2f
--- /dev/null
+++ 
b/tests/test-matlab-ts-mode-indent-xr-files/indent_xr_i_cont_incomplete3_expected.org
@@ -0,0 +1,105 @@
+#+startup: showall
+
+* Executing commands from indent_xr_i_cont_incomplete3.m:2:2:
+
+  (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+
+- Invoking      : "C-n" = next-line
+  Start point   :  182
+  Moved to point:  224
+  : 3:41: function a = indent_xr_i_cont_incomplete1
+  :                                                ^
+  No buffer modifications
+
+- Invoking      : "C-e" = move-end-of-line
+  Start point   :  224
+  No point movement
+  No buffer modifications
+
+- Invoking      : "C-m" = newline
+  Start point   :  224
+  Moved to point:  229
+  : 4:4:     
+  :          ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,4 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+ function a = indent_xr_i_cont_incomplete1
++    
+ end
+  #+end_src diff
+
+- Invoking      : (insert "a = ...")
+  Start point   :  229
+  Moved to point:  236
+  : 4:11:     a = ...
+  :                  ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -1,5 +1,5 @@
+ % -*- matlab-ts -*-
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+ function a = indent_xr_i_cont_incomplete1
+-    
++    a = ...
+ end
+  #+end_src diff
+
+- Invoking      : "C-m" = newline
+  Start point   :  236
+  Moved to point:  245
+  : 5:8:         
+  :              ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,4 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+ function a = indent_xr_i_cont_incomplete1
+     a = ...
++        
+ end
+  #+end_src diff
+
+- Invoking      : (insert "99;")
+  Start point   :  245
+  Moved to point:  248
+  : 5:11:         99;
+  :                  ^
+  Buffer modified:
+  #+begin_src diff
+--- start_contents
++++ end_contents
+@@ -2,5 +2,5 @@
+ % (t-utils-xr "C-n" "C-e" "C-m" (insert "a = ...") "C-m" (insert "99;") 
(re-search-backward "^fun") (print (buffer-substring-no-properties (point) 
(point-max))))
+ function a = indent_xr_i_cont_incomplete1
+     a = ...
+-        
++        99;
+ end
+  #+end_src diff
+
+- Invoking      : (re-search-backward "^fun")
+  Start point   :  248
+  Moved to point:  183
+  : 3:0: function a = indent_xr_i_cont_incomplete1
+  :      ^
+  No buffer modifications
+
+- Invoking      : (print (buffer-substring-no-properties (point) (point-max)))
+  Start point   :  183
+  No point movement
+  standard-output:
+    "function a = indent_xr_i_cont_incomplete1
+      a = ...
+          99;
+  end
+  "
+  No buffer modifications

Reply via email to