texlive[47964] trunk: latexindent (9jun18)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 9 00:10:34 CEST 2018


Revision: 47964
          http://tug.org/svn/texlive?view=revision&revision=47964
Author:   karl
Date:     2018-06-09 00:10:31 +0200 (Sat, 09 Jun 2018)
Log Message:
-----------
latexindent (9jun18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/bin/win32/latexindent.exe
    trunk/Master/texmf-dist/doc/support/latexindent/README
    trunk/Master/texmf-dist/doc/support/latexindent/appendices.tex
    trunk/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
    trunk/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex
    trunk/Master/texmf-dist/doc/support/latexindent/title.tex
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
    trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
    trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-06-08 22:10:31 UTC (rev 47964)
@@ -1,12 +1,12 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 47935 2018-06-05 22:36:22Z karl $
+# $Id: tlmgr.pl 47951 2018-06-07 05:55:43Z preining $
 #
 # Copyright 2008-2018 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 47935 $';
-my $datrev = '$Date: 2018-06-06 00:36:22 +0200 (Wed, 06 Jun 2018) $';
+my $svnrev = '$Revision: 47951 $';
+my $datrev = '$Date: 2018-06-07 07:55:43 +0200 (Thu, 07 Jun 2018) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -7261,22 +7261,23 @@
   my @dirents = readdir (DIR);
   closedir (DIR) || warn "closedir($backupdir) failed: $!";
   my @backups;
+  my $extre = "(" . join("|", map { $CompressorExtension{$_} } @AcceptedCompressors) . ")";
   for my $dirent (@dirents) {
     next if (-d $dirent);
-    next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.xz$/);
-    push @backups, $1;
+    next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.$extre$/);
+    push @backups, [ $1, $dirent ] ;
   }
   my $i = 1;
-  for my $e (reverse sort {$a <=> $b} @backups) {
+  for my $e (reverse sort {$a->[0] <=> $b->[0]} @backups) {
     if ($i > $autobackup) {
       # only echo out if explicitly asked for verbose which is done
       # in the backup --clean action
       if ($verb) {
-        info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+        info ("Removing backup $backupdir/$e->[1]\n");
       } else {
-        debug ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+        debug ("Removing backup $backupdir/$e->[1]\n");
       }
-      unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun;
+      unlink("$backupdir/$e->[1]") unless $dryrun;
     }
     $i++;
   }
@@ -9694,7 +9695,7 @@
 distribution (L<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 47935 2018-06-05 22:36:22Z karl $
+$Id: tlmgr.pl 47951 2018-06-07 05:55:43Z preining $
 =cut
 
 # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/bin/win32/latexindent.exe
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2018-06-08 22:10:31 UTC (rev 47964)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.4.2, 2018-04-27
+    latexindent.pl, version 3.4.3, 2018-06-08
 
     PERL script to indent code within environments, and align delimited 
     environments in .tex files.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/appendices.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/appendices.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/appendices.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -109,7 +109,7 @@
 		\end{enumerate}
 		To \emph{remove} the files, run
 		\begin{commandshell}
-sudo make uninstall}.
+sudo make uninstall
     \end{commandshell}
 	\subsection{Add to path for Windows}
 		To add \texttt{latexindent.exe} to the path for Windows, follow these steps:
@@ -185,34 +185,17 @@
 
 	 The fields given in \cref{lst:obsoleteYaml} are \emph{obsolete} from Version 3.0
 	 onwards.
-	 \begin{yaml}[style=yaml-LST,numbers=none]{Obsolete YAML fields from Version 3.0}[colframe=white!25!red,colbacktitle=white!75!red,colback=white!90!red,]{lst:obsoleteYaml}
-alwaysLookforSplitBrackets
-alwaysLookforSplitBrackets
-checkunmatched
-checkunmatchedELSE
-checkunmatchedbracket
-constructIfElseFi
-\end{yaml}
+	 \cmhlistingsfromfile{demonstrations/obsolete.yaml}[yaml-obsolete]{Obsolete YAML fields from Version 3.0}{lst:obsoleteYaml}
 
 	 There is a slight difference when specifying indentation after headings; specifically,
 	 we now write \texttt{indentAfterThisHeading} instead of \texttt{indent}. See \cref{lst:indentAfterThisHeadingOld,lst:indentAfterThisHeadingNew}
 
 	 \begin{minipage}{.45\textwidth}
-		 \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld}
-indentAfterHeadings:
-    part:
-       indent: 0
-       level: 1
-\end{yaml}
+		 \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingOld.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld}
 	 \end{minipage}%
 	 \hfill
 	 \begin{minipage}{.45\textwidth}
-		 \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew}
-indentAfterHeadings:
-    part:
-       indentAfterThisHeading: 0
-       level: 1
-\end{yaml}
+		 \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingNew.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew}
 	 \end{minipage}%
 
 	 To specify \texttt{noAdditionalIndent} for display-math environments in Version 2.2, you would write YAML
@@ -220,26 +203,13 @@
 	 or, if you're using \texttt{-m} switch, \cref{lst:indentAfterThisHeadingNew2}.
 
 	 \begin{minipage}{.45\textwidth}
-		 \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld}
-noAdditionalIndent:
-    \[: 0
-    \]: 0
-\end{yaml}
+		 \cmhlistingsfromfile{demonstrations/noAddtionalIndentOld.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld}
 	 \end{minipage}%
 	 \hfill
 	 \begin{minipage}{.45\textwidth}
-		 \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1}
-specialBeginEnd:
-    displayMath:
-        begin: '\\\['
-        end: '\\\]'
-        lookForThis: 0
-\end{yaml}
+		 \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1}
 
-		 \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath}  in Version 3.0}{lst:indentAfterThisHeadingNew2}
-noAdditionalIndent:
-    displayMath: 1
-\end{yaml}
+		 \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew1.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath}  in Version 3.0}{lst:indentAfterThisHeadingNew2}
 	 \end{minipage}%
 
 	 \mbox{}\hfill     \begin{minipage}{.25\textwidth}

Modified: trunk/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -1,10 +1,12 @@
-\newcommand{\cmhlistingsfromfile}[3]{
+\newcommand{\cmhlistingsfromfile}[4]{
 .. literalinclude:: #1^^J
+^^I:class: .#4^^J
 ^^I:caption: #2^^J
 ^^I:name: #3^^J
 }
-\newcommand{\cmhlistingsfromfilefour}[5]{
+\newcommand{\cmhlistingsfromfilefour}[6]{
 .. literalinclude:: #3^^J
+^^I:class: .#6^^J
 ^^I:caption: #4^^J
 ^^I:name: #5^^J
 ^^I:lines: #1-#2^^J

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -175,6 +175,20 @@
 			enhanced,
 			overlay={\node[anchor=north east,outer sep=2pt,draw=cmhgold,very thick,double,fill=harvestgold,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-m}}; }
 		},
+	yaml-obsolete/.style={
+			listing only,
+			listing engine=listings,
+			left=0cm,
+			boxrule=0pt,
+			%leftrule=3pt,
+			sharp corners,
+			center title,
+			toprule=2pt,
+			titlerule=2pt,
+			colframe=white!25!red,
+			colbacktitle=white!75!red,
+			colback=white!90!red,
+		},
 	new-to-this-version/.style={
 			enhanced,
 			overlay app={\node at ([yshift=0mm,xshift=0mm]frame.north east) {\stardemo[scale=1.2]}; },
@@ -332,115 +346,115 @@
 
 \lstdefinestyle{indentAfterItems}{
 	style=yaml-LST,
-	firstnumber=183,linerange={183-187},
+	firstnumber=182,linerange={182-186},
 	numbers=left,
 }
 
 \lstdefinestyle{itemNames}{
 	style=yaml-LST,
-	firstnumber=193,linerange={193-195},
+	firstnumber=192,linerange={192-194},
 	numbers=left,
 }
 
 \lstdefinestyle{specialBeginEnd}{
 	style=yaml-LST,
-	firstnumber=199,linerange={199-212},
+	firstnumber=198,linerange={198-211},
 	numbers=left,
 }
 
 \lstdefinestyle{indentAfterHeadings}{
 	style=yaml-LST,
-	firstnumber=222,linerange={222-231},
+	firstnumber=221,linerange={221-230},
 	numbers=left,
 }
 
 \lstdefinestyle{noAdditionalIndentGlobalEnv}{
 	style=yaml-LST,
-	firstnumber=280,linerange={280-281},
+	firstnumber=279,linerange={279-280},
 	numbers=left,
 }
 
 \lstdefinestyle{noAdditionalIndentGlobal}{
 	style=yaml-LST,
-	firstnumber=280,linerange={280-292},
+	firstnumber=279,linerange={279-291},
 	numbers=left,
 }
 
 \lstdefinestyle{indentRulesGlobalEnv}{
 	style=yaml-LST,
-	firstnumber=296,linerange={296-297},
+	firstnumber=295,linerange={295-296},
 	numbers=left,
 }
 
 \lstdefinestyle{indentRulesGlobal}{
 	style=yaml-LST,
-	firstnumber=296,linerange={296-308},
+	firstnumber=295,linerange={295-307},
 	numbers=left,
 }
 
 \lstdefinestyle{commandCodeBlocks}{
 	style=yaml-LST,
-	firstnumber=311,linerange={311-325},
+	firstnumber=310,linerange={310-324},
 	numbers=left,
 }
 
 \lstdefinestyle{modifylinebreaks}{
 	style=yaml-LST,
-	firstnumber=395,linerange={395-397},
+	firstnumber=394,linerange={394-396},
 	numbers=left,
 }
 
 \lstdefinestyle{textWrapOptions}{
 	style=yaml-LST,
-	firstnumber=398,linerange={398-399},
+	firstnumber=397,linerange={397-398},
 	numbers=left,
 }
 
 \lstdefinestyle{textWrapOptionsAll}{
 	style=yaml-LST,
-	firstnumber=398,linerange={398-400},
+	firstnumber=397,linerange={397-399},
 	numbers=left,
 }
 
 \lstdefinestyle{removeParagraphLineBreaks}{
 	style=yaml-LST,
-	firstnumber=423,linerange={423-435},
+	firstnumber=422,linerange={422-434},
 	numbers=left,
 }
 
 \lstdefinestyle{paragraphsStopAt}{
 	style=yaml-LST,
-	firstnumber=436,linerange={436-444},
+	firstnumber=435,linerange={435-443},
 	numbers=left,
 }
 
 \lstdefinestyle{oneSentencePerLine}{
 	style=yaml-LST,
-	firstnumber=401,linerange={401-422},
+	firstnumber=400,linerange={400-421},
 	numbers=left,
 }
 
 \lstdefinestyle{sentencesFollow}{
 	style=yaml-LST,
-	firstnumber=404,linerange={404-412},
+	firstnumber=403,linerange={403-411},
 	numbers=left,
 }
 
 \lstdefinestyle{sentencesBeginWith}{
 	style=yaml-LST,
-	firstnumber=413,linerange={413-416},
+	firstnumber=412,linerange={412-415},
 	numbers=left,
 }
 
 \lstdefinestyle{sentencesEndWith}{
 	style=yaml-LST,
-	firstnumber=417,linerange={417-422},
+	firstnumber=416,linerange={416-421},
 	numbers=left,
 }
 
 \lstdefinestyle{modifylinebreaksEnv}{
 	style=yaml-LST,
-	firstnumber=445,linerange={445-454},
+	firstnumber=444,linerange={444-453},
 	numbers=left,
 }
 

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -339,20 +339,9 @@
 
 	You can use the rule in any of the ways described in \cref{lst:arara} (or combinations thereof).
 	In fact, \texttt{arara} allows yet greater flexibility -- you can use \texttt{yes/no}, \texttt{true/false}, or \texttt{on/off} to toggle the various options.
-	\begin{cmhlistings}[style=demo,escapeinside={(*@}{@*)}]{\texttt{arara} sample usage}{lst:arara}
-%(*@@*) arara: indent
-%(*@@*) arara: indent: {overwrite: yes}
-%(*@@*) arara: indent: {output: myfile.tex}
-%(*@@*) arara: indent: {silent: yes}
-%(*@@*) arara: indent: {trace: yes}
-%(*@@*) arara: indent: {localSettings: yes}
-%(*@@*) arara: indent: {onlyDefault: on}
-%(*@@*) arara: indent: { cruft: /home/cmhughes/Desktop }
-\documentclass{article}
-...
-\end{cmhlistings}
-	%(*@@*) arara: indent: { modifylinebreaks: yes }
 
+	\cmhlistingsfromfile{demonstrations/arara-demo.tex}{\texttt{arara} sample usage}{lst:arara}
+
 	Hopefully the use of these rules is fairly self-explanatory, but for completeness
 	\cref{tab:orbsandswitches} shows the relationship between \texttt{arara} directive arguments and the
 	switches given in \cref{sec:commandline}.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -356,10 +356,11 @@
 	it to \texttt{0}, and you can experiment with the \texttt{other} field.
 
 	The \texttt{basicFullStop} routine should probably be avoided in most situations, as it does not accomodate the specifications
-	above. For example, using the YAML in \cref{lst:alt-full-stop1-yaml} gives the output from the following command in \cref{lst:url-mod2}.
+	above. For example, using the following command
 	\begin{commandshell}
 latexindent.pl url -m -l=alt-full-stop1.yaml
 \end{commandshell}
+	and the YAML in \cref{lst:alt-full-stop1-yaml} gives the output in \cref{lst:url-mod2}.
 
 	\begin{adjustwidth}{-3.5cm}{-1.5cm}
 		\begin{minipage}{.6\linewidth}
@@ -1031,17 +1032,17 @@
 		\toprule
 		Code block                             & Sample                                                  & \multicolumn{2}{c}{Poly-switch mapping}                                                                     \\
 		\midrule
-		environment                            & \verb!before words!$\BeginStartsOnOwnLine$       & $\BeginStartsOnOwnLine$                 & BeginStartsOnOwnLine                                              \\
-		                                       & \verb!\begin{myenv}!$\BodyStartsOnOwnLine$        & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
-		                                       & \verb!body of myenv!$\EndStartsOnOwnLine$         & $\EndStartsOnOwnLine$                   & EndStartsOnOwnLine                                                \\
-		                                       & \verb!\end{myenv}!$\EndFinishesWithLineBreak$   & $\EndFinishesWithLineBreak$             & EndFinishesWithLineBreak                                          \\
-		                                       & \verb!after words!                              &                                         &                                                                   \\
+		environment                            & \verb!before words!$\BeginStartsOnOwnLine$      & $\BeginStartsOnOwnLine$                 & BeginStartsOnOwnLine                                              \\
+		                                       & \verb!\begin{myenv}!$\BodyStartsOnOwnLine$       & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
+		                                       & \verb!body of myenv!$\EndStartsOnOwnLine$        & $\EndStartsOnOwnLine$                   & EndStartsOnOwnLine                                                \\
+		                                       & \verb!\end{myenv}!$\EndFinishesWithLineBreak$  & $\EndFinishesWithLineBreak$             & EndFinishesWithLineBreak                                          \\
+		                                       & \verb!after words!                             &                                         &                                                                   \\
 		\cmidrule{2-4}
-		ifelsefi                               & \verb!before words!$\BeginStartsOnOwnLine$       & $\BeginStartsOnOwnLine$                 & IfStartsOnOwnLine                                                 \\
-		                                       & \verb!\if...!$\BodyStartsOnOwnLine$        & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
-		                                       & \verb!body of if/or statement!$\OrStartsOnOwnLine$          & $\OrStartsOnOwnLine$                    & OrStartsOnOwnLine                                                 %
+		ifelsefi                               & \verb!before words!$\BeginStartsOnOwnLine$      & $\BeginStartsOnOwnLine$                 & IfStartsOnOwnLine                                                 \\
+		                                       & \verb!\if...!$\BodyStartsOnOwnLine$       & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
+		                                       & \verb!body of if/or statement!$\OrStartsOnOwnLine$         & $\OrStartsOnOwnLine$                    & OrStartsOnOwnLine                                                 %
 		\announce*{2018-04-27}{new ifElseFi code block polyswitches}                                                                                                                                                   \\
-		                                       & \verb!\or!$\OrFinishesWithLineBreak$    & $\OrFinishesWithLineBreak$              & OrFinishesWithLineBreak                                           \\
+		                                       & \verb!\or!$\OrFinishesWithLineBreak$   & $\OrFinishesWithLineBreak$              & OrFinishesWithLineBreak                                           \\
 		                                       & \verb!body of if/or statement!$\ElseStartsOnOwnLine$       & $\ElseStartsOnOwnLine$                  & ElseStartsOnOwnLine                                               \\
 		                                       & \verb!\else!$\ElseFinishesWithLineBreak$ & $\ElseFinishesWithLineBreak$            & ElseFinishesWithLineBreak                                         \\
 		                                       & \verb!body of else statement!$\EndStartsOnOwnLine$        & $\EndStartsOnOwnLine$                   & FiStartsOnOwnLine                                                 \\

Modified: trunk/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -201,7 +201,7 @@
 	There are some special command names%
 	\announce*{2018-04-27}*{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl},
 	the first one of which is \lstinline!\@ifnextchar[!. From the perspective of \texttt{latexindent.pl}, the whole of the
-	text \lstinline!\@ifnextchar[! is is a command, because it is
+	text \lstinline!\@ifnextchar[! is a command, because it is
 	immediately followed by sets of mandatory arguments. However, without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl}
 	would not be able to label it as such, because the \lstinline![! is, necessarily, not matched by a closing \lstinline!]!.
 

Modified: trunk/Master/texmf-dist/doc/support/latexindent/title.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2018-06-08 22:10:31 UTC (rev 47964)
@@ -8,7 +8,7 @@
 			sharp corners,
 			enhanced,
 			overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }]
-		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4.2
+		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4.3
 	\end{tcolorbox}
 }
 \author{Chris Hughes \thanks{and contributors!

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -26,8 +26,9 @@
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces/;
+our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/;
 our $commandCounter;
+our $braceBracketRegExpBasic = qr/\{|\[/;
 
 sub find_commands_or_key_equals_values_braces{
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -38,8 +38,8 @@
 
 # code blocks
 use LatexIndent::Verbatim qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands  put_verbatim_commands_back_in/;
-use LatexIndent::Environment qw/find_environments/;
-use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp/;
+use LatexIndent::Environment qw/find_environments $environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
 use LatexIndent::Else qw/check_for_else_statement/;
 use LatexIndent::Arguments qw/get_arguments_regexp find_opt_mand_arguments get_numbered_arg_regexp construct_arguments_regexp/;
 use LatexIndent::OptionalArgument qw/find_optional_arguments/;
@@ -46,13 +46,13 @@
 use LatexIndent::MandatoryArgument qw/find_mandatory_arguments get_mand_arg_reg_exp/;
 use LatexIndent::RoundBrackets qw/find_round_brackets/;
 use LatexIndent::Item qw/find_items construct_list_of_items/;
-use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces/;
+use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/;
 use LatexIndent::Command qw/construct_command_regexp/;
 use LatexIndent::KeyEqualsValuesBraces qw/construct_key_equals_values_regexp/;
 use LatexIndent::NamedGroupingBracesBrackets qw/construct_grouping_braces_brackets_regexp/;
 use LatexIndent::UnNamedGroupingBracesBrackets qw/construct_unnamed_grouping_braces_brackets_regexp/;
-use LatexIndent::Special qw/find_special construct_special_begin/;
-use LatexIndent::Heading qw/find_heading construct_headings_levels/;
+use LatexIndent::Special qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
+use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/;
 use LatexIndent::FileContents qw/find_file_contents_environments_and_preamble/;
 use LatexIndent::Preamble;
 
@@ -181,18 +181,18 @@
 
     # search for environments
     $logger->trace('looking for ENVIRONMENTS') if $is_t_switch_active;
-    $self->find_environments;
+    $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
 
     # search for ifElseFi blocks
     $logger->trace('looking for IFELSEFI') if $is_t_switch_active;
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     # search for headings (part, chapter, section, setc)
     $logger->trace('looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active;
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
 
     # the ordering of finding commands and special code blocks can change
-    $self->find_commands_or_key_equals_values_braces_and_special;
+    $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
     
     # documents without preamble need a manual call to the paragraph_one_line routine
     if ($is_m_switch_active and !${$self}{preamblePresent}){
@@ -222,19 +222,19 @@
     if(${$masterSettings{specialBeginEnd}}{specialBeforeCommand}){
         # search for special begin/end
         $logger->trace('looking for SPECIAL begin/end *before* looking for commands (see specialBeforeCommand)') if $is_t_switch_active;
-        $self->find_special;
+        $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
 
         # search for commands with arguments
         $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active;
-        $self->find_commands_or_key_equals_values_braces;
+        $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
     } else {
         # search for commands with arguments
         $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active;
-        $self->find_commands_or_key_equals_values_braces;
+        $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
 
         # search for special begin/end
         $logger->trace('looking for SPECIAL begin/end') if $is_t_switch_active;
-        $self->find_special;
+        $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
     }
     return;
 }
@@ -311,13 +311,13 @@
     $self->adjust_replacement_text_line_breaks_at_end;
 
     # modify line breaks on body and end statements
-    $self->modify_line_breaks_body;
+    $self->modify_line_breaks_body if $is_m_switch_active;
 
     # modify line breaks end statements
-    $self->modify_line_breaks_end;
+    $self->modify_line_breaks_end if $is_m_switch_active;
 
     # check the body for current children
-    $self->check_for_hidden_children;
+    $self->check_for_hidden_children if ${$self}{body} =~ m/$tokens{beginOfToken}/;
 
     return;
 }

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,6 +20,9 @@
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
 use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Braces qw/$braceBracketRegExpBasic/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -99,13 +102,13 @@
     my $self = shift;
 
     # search for headings (important to do this before looking for commands!)
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
 
     # search for commands and special code blocks
-    $self->find_commands_or_key_equals_values_braces_and_special;
+    $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
     
     # search for arguments
-    $self->find_opt_mand_arguments;
+    $self->find_opt_mand_arguments if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
 
     return;
 }

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -18,13 +18,19 @@
 use warnings;
 use LatexIndent::Tokens qw/%tokens/;
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
+use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Braces qw/$braceBracketRegExpBasic/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_environments/;
+our @EXPORT_OK = qw/find_environments $environmentBasicRegExp/;
 our $environmentCounter;
+our $environmentBasicRegExp = qr/\\begin\{/;
 
 # store the regular expresssion for matching and replacing the \begin{}...\end{} statements
 our $environmentRegExp = qr/
@@ -99,19 +105,19 @@
     }
 
     # search for items as the first order of business
-    $self->find_items;
+    $self->find_items if ${$masterSettings{indentAfterItems}}{${$self}{name}};
 
     # search for headings (important to do this before looking for commands!)
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
 
     # search for commands and special code blocks
-    $self->find_commands_or_key_equals_values_braces_and_special;
+    $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
 
     # search for arguments
-    $self->find_opt_mand_arguments;
+    $self->find_opt_mand_arguments if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
 }
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,6 +20,10 @@
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Environment qw/$environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/;
@@ -216,16 +220,16 @@
     my $self = shift;
 
     # search for environments
-    $self->find_environments;
+    $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     # search for headings (part, chapter, section, setc)
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
     
     # search for commands and special code blocks
-    $self->find_commands_or_key_equals_values_braces_and_special;
+    $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
 }
 
 1;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -455,7 +455,7 @@
         $self->alignment_at_ampersand_settings;
 
         # check for line break settings
-        $self->modify_line_breaks_settings;
+        $self->modify_line_breaks_settings if $is_m_switch_active;
 
         # store the settings
         %{${previouslyFoundSettings}{$storageName}} = (
@@ -535,9 +535,6 @@
 }
 
 sub modify_line_breaks_settings{
-    # return with undefined values unless the -m switch is active
-    return unless $is_m_switch_active;
-
     my $self = shift;
 
     # grab the logging object

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -21,10 +21,11 @@
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_heading construct_headings_levels/;
+our @EXPORT_OK = qw/find_heading construct_headings_levels $allHeadingsRegexp/;
 our $headingCounter;
 our @headingsRegexpArray;
 our $allHeadingsRegexp = q();
@@ -226,7 +227,7 @@
     }
 
     # search for special begin/end
-    $self->find_special;
+    $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
 
     return;
 }

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -156,9 +156,6 @@
 
     my $self = shift;
 
-    # if there are no hidden children, then exit
-    return if ${$self}{body} !~ m/$tokens{beginOfToken}/;
-
     # grab the matches
     my @matched = (${$self}{body} =~ /((?:$tokens{ifelsefiSpecial})?$tokens{beginOfToken}.[-a-z0-9]+?$tokens{endOfToken})/ig);
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,12 +20,14 @@
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
 use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp/;
+our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
 our $ifElseFiCounter;
 our $ifElseFiRegExp;
+our $ifElseFiBasicRegExp = qr/\\if/;
 
 # store the regular expresssion for matching and replacing the \if...\else...\fi statements
 # note: we search for \else separately in an attempt to keep this regexp a little more managable
@@ -148,7 +150,7 @@
                                                                 );
 
     # search for headings (important to do this before looking for commands!)
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
 
     # search for commands and special code blocks
     $self->find_commands_or_key_equals_values_braces_and_special;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -21,6 +21,9 @@
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -66,8 +69,6 @@
 
     my $self = shift;
 
-    return unless ${$masterSettings{indentAfterItems}}{${$self}{name}};
-
     # otherwise loop through the item names
     $logger->trace("Searching for items (see itemNames) in ${$self}{name} (see indentAfterItems)") if $is_t_switch_active;
     $logger->trace(Dumper(\%{$masterSettings{itemNames}})) if $is_tt_switch_active;
@@ -123,13 +124,13 @@
     ${${$self}{linebreaksAtEnd}}{body}=1 if(${$self}{body} =~ m/\R+$/s );
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     # search for headings (part, chapter, section, setc)
-    $self->find_heading;
+    $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
     
     # search for commands and special code blocks
-    $self->find_commands_or_key_equals_values_braces_and_special;
+    $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
 
 }
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -159,6 +159,8 @@
         $logger->info("Filename: ${$self}{fileName}");
     } else {
         $logger->info("Reading input from STDIN");
+        my $buttonText = ($FindBin::Script eq 'latexindent.exe') ? 'CTRL+Z followed by ENTER':'CTRL+D';
+        print "Please enter text to be indented: (press $buttonText when finished)\n";
     }
 
     # log the switches from the user

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,6 +20,8 @@
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
 our @EXPORT_OK = qw/find_mandatory_arguments get_mand_arg_reg_exp/;
@@ -121,10 +123,10 @@
     my $self = shift;
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     # search for special begin/end
-    $self->find_special;
+    $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
 
 }
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,6 +20,8 @@
 use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
 our @EXPORT_OK = qw/find_optional_arguments/;
@@ -106,10 +108,10 @@
     my $self = shift;
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     # search for special begin/end
-    $self->find_special;
+    $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
 
 }
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -20,6 +20,9 @@
 use LatexIndent::Switches qw/$is_t_switch_active/;
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Environment qw/$environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
 our $preambleCounter;
 
@@ -49,14 +52,14 @@
     my $self = shift;
 
     # search for environments
-    $self->find_environments;
+    $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/;
 
     # search for ifElseFi blocks
-    $self->find_ifelsefi;
+    $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
 
     if(${$masterSettings{specialBeginEnd}}{specialBeforeCommand}){
         # search for special begin/end
-        $self->find_special;
+        $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
 
         # search for commands with arguments
         $self->find_commands_or_key_equals_values_braces if(!$masterSettings{preambleCommandsBeforeEnvironments});
@@ -65,7 +68,7 @@
         $self->find_commands_or_key_equals_values_braces if(!$masterSettings{preambleCommandsBeforeEnvironments});
 
         # search for special begin/end
-        $self->find_special;
+        $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
       }
 
 }

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -21,14 +21,17 @@
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_special construct_special_begin/;
+our @EXPORT_OK = qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
 our $specialCounter;
 our $specialBegins = q();
 our $specialAllMatchesRegExp = q();
 our %individualSpecialRegExps;
+our $specialBeginAndBracesBracketsBasicRegExp;
+our $specialBeginBasicRegExp;
 
 sub construct_special_begin{
     my $self = shift;
@@ -102,6 +105,10 @@
     $logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
     $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active;
 
+    # basic special begin regexp
+    $specialBeginBasicRegExp = qr/$specialBegins/;
+    $specialBeginAndBracesBracketsBasicRegExp = $specialBegins."|\\{|\\[";
+    $specialBeginAndBracesBracketsBasicRegExp = qr/$specialBeginAndBracesBracketsBasicRegExp/;
   }
 
 sub find_special{

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2018-06-08 22:10:31 UTC (rev 47964)
@@ -19,6 +19,6 @@
 use Exporter qw/import/;
 our @EXPORT_OK = qw/$versionNumber $versionDate/;
 
-our $versionNumber = '3.4.2';
-our $versionDate = '2018-04-27';
+our $versionNumber = '3.4.3';
+our $versionDate = '2018-06-08';
 1

Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2018-06-08 22:08:37 UTC (rev 47963)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2018-06-08 22:10:31 UTC (rev 47964)
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.4.2, 2018-04-27
+# defaultSettings.yaml for latexindent.pl, version 3.4.3, 2018-06-08
 #                      a script that aims to
 #                      beautify .tex, .sty, .cls files
 #
@@ -23,8 +23,8 @@
 
 # You're welcome to change anything you like in here, but 
 # it would probably be better to have your own user settings 
-# files somewhere else- remember that this file may be overwritten
-# anytime that you update your distribution. Please see the manual
+# files somewhere else - remember that this file may be overwritten
+# when you update your distribution. Please see the manual
 # for details of how to setup your own settings files.
 #
 # Please read the manual first to understand what each switch does.
@@ -49,9 +49,9 @@
 #       myfileBACKUP.bak
 backupExtension: .bak
 
-# only one backup per file; if onlyOneBackUp is 0 then the
-# number on the extension increments by 1 each time
-# (this is in place as a safety measure) myfile.bak0, myfile.bak1, myfile.bak2
+# only one backup per file; if onlyOneBackUp is 0 then, as a safety measure, 
+# the number on the extension increments by 1 each time:
+#     myfile.bak0, myfile.bak1, myfile.bak2
 #
 # if you set onlyOnebackUp to 1, then the backup file will
 # be overwritten each time (not recommended until you trust the script)
@@ -88,8 +88,8 @@
         trace: "%A%n"
         ttrace: "%A%n"
 
-#  verbatim environments- environments specified 
-#  in this hash table will not be changed at all!
+#  verbatim environments specified 
+#  in this field will not be changed at all!
 verbatimEnvironments:
     verbatim: 1
     lstlisting: 1
@@ -139,8 +139,7 @@
 # Default value of indentation
 defaultIndent: "\t"
 
-# environments that have tab delimiters, add more 
-# as needed
+# name of code blocks that should have their body aligned at ampersand delimiters
 lookForAlignDelims:
    tabular: 
       delims: 1
@@ -187,7 +186,7 @@
     list: 1
 
 # if you want to use other names for your items (such as, for example, part)
-# then populate them here- note that you can trick latexindent.pl
+# then populate them here; note that you can trick latexindent.pl
 # into indenting all kinds of commands (within environments specified in 
 # indentAfterItems) using this technique.
 itemNames:
@@ -250,7 +249,7 @@
 
 # if you don't want to have additional indentation 
 # in an environment put it in this hash table; note that
-# environments in this hash table will inherit 
+# environments in this field will inherit 
 # the *current* level of indentation they just won't
 # get any *additional*.
 noAdditionalIndent:

Modified: trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)



More information about the tex-live-commits mailing list