branch: externals/matlab-mode
commit 0fc695d7bd8c806510f4f0d08ecb0cff0c55bf51
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
NEWS.org: update 8.0.0 release description
---
NEWS.org | 275 +--------------------------------------------------------------
1 file changed, 2 insertions(+), 273 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index d803541f3b..8dbccea91d 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -3,7 +3,7 @@
# Copyright (C) 2025-2026 Free Software Foundation, Inc.
-* Release 8.0.0 TBD
+* Release 8.0.0 Jan-29-2026
This release updates matlab-ts-mode indent to /electric indent code/. This is
sometimes called
pretty printing code or formatting code.
@@ -13,278 +13,7 @@ To indent a MATLAB ~*.m~ file,
: C-x h or M-: (mark-whole-buffer)
: C-M-\ or M-x indent-region
-MATLAB indent now:
-
-1. *Adjusts the indent-level (the whitespace to the left of the code)*
-
- Example:
-
- #+begin_src matlab
- function a = foo(b, c)
- a = b + ...
- c;
- end
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- function a = foo(b, c)
- a = b + ...
- c;
- end
- #+end_src
-
-2. *Standardizes language element spacing*
-
- Example:
-
- #+begin_src matlab
- a+b * c/ d-1;
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- a + b * c / d - 1;
- #+end_src
-
-3. *Aligns consecutive assignments*
-
- Example:
-
- #+begin_src matlab
- rLength =12354 ;
- rWidth=2;
- rArea=rLength *rWidth;
- #+end_src
-
- Intents to:
-
- #+begin_src matlab
- rLength = 12354;
- rWidth = 2;
- rArea = rLength * rWidth;
- #+end_src
-
- For alignment, the statements must be consecutive. For example, the
following contains two
- sections of consecutive statement alignment:
-
- #+begin_src matlab
- aReallyLongVariable = 10;
- bShortVar = 5;
-
- c = aReallyLongVariable + bShortVar;
- c2 = c * 2;
- #+end_src
-
-4. *Aligns consecutive properties*
-
- Example:
-
- #+begin_src matlab
- classdef myClass
- properties
- p1 ( 1,:) {mustBeNumeric, mustBeReal} = [0, 0, 0];
- longProperty2 (1, 3) {mustBeNumeric, mustBeReal} = [0, 0, 0];
- p3(1,2 )
- end
- end
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- classdef myClass
- properties
- p1 (1,:) {mustBeNumeric, mustBeReal} = [0, 0, 0];
- longProperty2 (1,3) {mustBeNumeric, mustBeReal} = [0, 0, 0];
- p3 (1,2)
- end
- end
- #+end_src
-
-5. *Aligns consecutive arguments*
-
- Example:
-
- #+begin_src matlab
- function myFcn(a, longInputVar, c)
- arguments
- a{ mustBeNumeric,
mustBeReal}
- longInputVar { mustBeNumeric,mustBeReal
,mustBeFinite}
- c{mustBeNumeric}
- end
- end
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- function myFcn(a, longInputVar, c)
- arguments
- a {mustBeNumeric, mustBeReal}
- longInputVar {mustBeNumeric, mustBeReal, mustBeFinite}
- c {mustBeNumeric}
- end
- end
- #+end_src
-
-6. *Aligns enumeration members*
-
- Example:
-
- #+begin_src matlab
- classdef TrafficLightColors < double
- enumeration
- red (1)
- green(2)
- yellow(3)
- end
- end
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- classdef TrafficLightColors < double
- enumeration
- red (1)
- green (2)
- yellow (3)
- end
- end
- #+end_src
-
-7. *Aligns consecutive trailing comments*
-
- Example:
-
- #+begin_src matlab
- s1 =5 ; % Average speed of the first vehicle in miles
per hour
- timeH1=2;% Time in hours traveled of first vehicle in hours
- distance1= s1 * timeH1; % Distance we've traveled in
miles
- disp(distance1)% Report how far we've
gone
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- s1 = 5; % Average speed of the first vehicle in miles
per hour
- timeH1 = 2; % Time in hours traveled of first vehicle in
hours
- distance1 = s1 * timeH1; % Distance we've traveled in miles
- disp(distance1) % Report how far we've gone
- #+end_src
-
-8. *Adds missing commas in arrays (matrices and cells)*
-
- Example:
-
- #+begin_src matlab
- mat1 = [1234,234 12234.24];
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- mat1 = [1234, 234, 12234.24];
- #+end_src
-
-9. *Aligns multi-line matrix columns*
-
- Example
-
- #+begin_src matlab
- mat2 = [1234,234 12234.24
- 1,2 3.41];
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- mat2 = [1234, 234, 12234.24
- 1, 2, 3.41];
- #+end_src
-
-10. *Aligns fields of multi-line structures*
-
- Example:
-
- #+begin_src matlab
- myStruct = struct( ...
- 'field1', (2+3)*4, ...
- 'longField2',"foo",...
- 'f3',2);
- #+end_src
-
- Indents to:
-
- #+begin_src matlab
- myStruct = struct( ...
- 'field1' , (2 + 3) * 4, ...
- 'longField2', "foo", ...
- 'f3' , 2);
- #+end_src
-
-11. *Removes tabs (convert TAB Characters to spaces)*
-
- Conversion of tab characters to spaces ensures that code looks the same
when using different
- levels of tab stops. For example, UNIX (POSIX) uses tab stops of 8 whereas
Microsoft uses tab
- stops of 4.
-
-** Indent Example
-
-Example:
-
- #+begin_src matlab
- function out= indent_example( in1, ...
- input2)
- % INDENT_EXAMPLE - an indent example
- % which illustrates the MATLAB indent engine.
- arguments
- in1 = 10
- input2= 20;
- end
-
- mat = [100,2
- 3 400];
-
- s = struct( 'f1',1, ...
- 'otherField', in1+input2);
-
- if abs(sum(in1)) > 0
- out=s.f1/input2+ in1;
- else
- out = mat+in1 * 2;
- end
- end
- #+end_src
-
-Is indented to the following using ~C-x h~ and then ~C-M-\~:
-
- #+begin_src matlab
- function out = indent_example(in1, ...
- input2)
- % INDENT_EXAMPLE - an indent example
- % which illustrates the MATLAB indent engine.
- arguments
- in1 = 10
- input2 = 20;
- end
-
- mat = [100, 2
- 3, 400];
-
- s = struct('f1' , 1, ...
- 'otherField', in1 + input2);
-
- if abs(sum(in1)) > 0
- out = s.f1 / input2 + in1;
- else
- out = mat + in1 * 2;
- end
- end
- #+end_src
+See [[file:doc/matlab-code-indent.org][doc/matlab-code-indent.org - MATLAB
Indent (Code Format)]]
* Release 7.4.2 Dec 29, 2025