From 37bec1919654a09195f7aa5875ce70b73be4426d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Mar 2021 21:43:54 +0000 Subject: latexindent (21mar21) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58596 c570f23f-e606-0410-a88d-b1316a301751 --- .../linked_scripts/latexindent/latexindent.pl | 2 +- Master/bin/win32/latexindent.exe | Bin 6371118 -> 6371356 bytes Master/texmf-dist/doc/support/latexindent/README | 2 +- .../doc/support/latexindent/appendices.tex | 3 --- .../doc/support/latexindent/latexindent.pdf | Bin 893716 -> 897615 bytes .../texmf-dist/doc/support/latexindent/title.tex | 2 +- .../scripts/latexindent/LatexIndent/LogFile.pm | 29 +++++++++++---------- .../LatexIndent/NamedGroupingBracesBrackets.pm | 25 ++++++++++++++++-- .../scripts/latexindent/LatexIndent/Version.pm | 4 +-- .../scripts/latexindent/defaultSettings.yaml | 6 ++--- .../texmf-dist/scripts/latexindent/latexindent.pl | 2 +- 11 files changed, 47 insertions(+), 28 deletions(-) diff --git a/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl b/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl index 77ae1fb829f..2c6dc044b8c 100755 --- a/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl +++ b/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.9, 2021-03-14 +# latexindent.pl, version 3.9.1, 2021-03-21 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/Master/bin/win32/latexindent.exe b/Master/bin/win32/latexindent.exe index 28406dfc3b1..b7afdb490e6 100755 Binary files a/Master/bin/win32/latexindent.exe and b/Master/bin/win32/latexindent.exe differ diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README index 08dd864b2e0..a8b0e8e1828 100644 --- a/Master/texmf-dist/doc/support/latexindent/README +++ b/Master/texmf-dist/doc/support/latexindent/README @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - latexindent.pl, version 3.9, 2021-03-14 + latexindent.pl, version 3.9.1, 2021-03-21 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/Master/texmf-dist/doc/support/latexindent/appendices.tex b/Master/texmf-dist/doc/support/latexindent/appendices.tex index 4036579e53a..c60445b1b70 100644 --- a/Master/texmf-dist/doc/support/latexindent/appendices.tex +++ b/Master/texmf-dist/doc/support/latexindent/appendices.tex @@ -61,7 +61,6 @@ curl -L http://cpanmin.us | perl - App::cpanminus cpanm YAML::Tiny cpanm File::HomeDir cpanm Unicode::GCString -cpanm Log::Dispatch \end{commandshell} For other distributions, the Ubuntu/Debian approach may work as follows @@ -71,7 +70,6 @@ sudo cpan -i App::cpanminus sudo cpanm YAML::Tiny sudo cpanm File::HomeDir sudo cpanm Unicode::GCString -sudo cpanm Log::Dispatch::File \end{commandshell} or else by running, for example, \begin{commandshell} @@ -118,7 +116,6 @@ brew install cpanm cpanm YAML::Tiny cpanm File::HomeDir cpanm Unicode::GCString -cpanm Log::Dispatch \end{commandshell} \subsubsection{Windows} diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf index c7e3178cc6b..dcb5eb21a00 100644 Binary files a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf and b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf differ diff --git a/Master/texmf-dist/doc/support/latexindent/title.tex b/Master/texmf-dist/doc/support/latexindent/title.tex index 724ebd1d208..5df477ecad9 100644 --- a/Master/texmf-dist/doc/support/latexindent/title.tex +++ b/Master/texmf-dist/doc/support/latexindent/title.tex @@ -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.9 + \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.9.1 \end{tcolorbox} } \author{Chris Hughes \thanks{and contributors! diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm index 8a35c3c2a27..ca8376daa9a 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm @@ -34,7 +34,7 @@ sub processSwitches{ if(scalar(@ARGV) < 1 or $switches{showhelp}) { print < output to another file; sample usage: - latexindent.pl -o outputfile.tex myfile.tex - latexindent.pl -o=outputfile.tex myfile.tex + latexindent.pl -o outputfile.tex myfile.tex + latexindent.pl -o=outputfile.tex myfile.tex -w, --overwrite overwrite the current file; a backup will be made, but still be careful -s, --silent @@ -52,12 +52,13 @@ usage: latexindent.pl [options] [file][.tex|.sty|.cls|.bib|...] -t, --trace tracing mode: verbose information given to the log file -l, --local[=myyaml.yaml] - use localSettings.yaml (assuming it exists in the directory of your file, - or in the current working directory); alternatively, use myyaml.yaml, if it exists; + use `localSettings.yaml`, `.localSettings.yaml`, `latexindent.yaml`, + or `.latexindent.yaml` (assuming one of them exists in the directory of your file or in + the current working directory); alternatively, use `myyaml.yaml`, if it exists; sample usage: - latexindent.pl -l some.yaml myfile.tex - latexindent.pl -l=another.yaml myfile.tex - latexindent.pl -l=some.yaml,another.yaml myfile.tex + latexindent.pl -l some.yaml myfile.tex + latexindent.pl -l=another.yaml myfile.tex + latexindent.pl -l=some.yaml,another.yaml myfile.tex -y, --yaml= specify YAML settings; sample usage: latexindent.pl -y="defaultIndent:' '" myfile.tex @@ -66,19 +67,19 @@ usage: latexindent.pl [options] [file][.tex|.sty|.cls|.bib|...] ONLY use defaultSettings.yaml, ignore ALL (yaml) user files -g, --logfile= used to specify the name of logfile (default is indent.log) - -c, --cruft= + -c, --cruft= used to specify the location of backup files and indent.log -m, --modifylinebreaks - modify linebreaks before, during, and at the end of code blocks; + modify linebreaks before, during, and at the end of code blocks; trailing comments and blank lines can also be added using this feature - -r,--replacement + -r, --replacement replacement mode, allows you to replace strings and regular expressions verbatim blocks not respected - -rv,--replacementrespectverb + -rv, --replacementrespectverb replacement mode, allows you to replace strings and regular expressions while respecting verbatim code blocks - -rr,--onlyreplacement - *only* replacement mode, no indentation + -rr, --onlyreplacement + *only* replacement mode, no indentation; verbatim blocks not respected ENDQUOTE ; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm index f20e23ca547..50b00ed556f 100755 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm @@ -35,8 +35,29 @@ sub construct_grouping_braces_brackets_regexp{ my $optAndMandRegExp = $self->get_arguments_regexp; # read from fine tuning - my $NamedGroupingBracesBracketsRegExp = qr/${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{name}/; - my $NamedGroupingFollowRegExp = qr/${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{follow}/; + my $NamedGroupingBracesBracketsRegExp = qr/${${$masterSettings{fineTuning}}{namedGroupingBracesBrackets}}{name}/; + my $NamedGroupingFollowRegExp = qr/${${$masterSettings{fineTuning}}{namedGroupingBracesBrackets}}{follow}/; + + # defaultSettings.yaml mistakenly had + # + # fineTuning: + # NamedGroupingBracesBrackets: + # + # when it should have been + # + # fineTuning: + # namedGroupingBracesBrackets: + # + # the mistake was mine, so I feel that the following is necessary; if we + # get to V4, then this will be removed and only namedGroupingBracesBrackets will be supported + if(${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{name}){ + $logger->warn("*fineTuning:NamedGroupingBracesBrackets is ok for now, but in future versions, fineTuning:namedGroupingBracesBrackets will be used"); + $NamedGroupingBracesBracketsRegExp = qr/${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{name}/; + } + if(${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{follow}){ + $logger->warn("*fineTuning:NamedGroupingBracesBrackets is ok for now, but in future versions, fineTuning:namedGroupingBracesBrackets will be used"); + $NamedGroupingFollowRegExp = qr/${${$masterSettings{fineTuning}}{NamedGroupingBracesBrackets}}{follow}/; + } # store the regular expresssion for matching and replacing $grouping_braces_regexp = qr/ diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index 17c5ddd1fcf..170b08f58f9 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -19,6 +19,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.9'; -our $versionDate = '2021-03-14'; +our $versionNumber = '3.9.1'; +our $versionDate = '2021-03-21'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index f12e0030a95..a794364f93b 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,4 +1,4 @@ -# defaultSettings.yaml for latexindent.pl, version 3.9, 2021-03-14 +# defaultSettings.yaml for latexindent.pl, version 3.9.1, 2021-03-21 # a script that aims to # beautify .tex, .sty, .cls files # @@ -618,9 +618,9 @@ fineTuning: commands: name: '[+a-zA-Z@\*0-9_\:]+?' keyEqualsValuesBracesBrackets: - name: '[a-zA-Z@\*0-9_\/.\h\{\}:\#-]+?' + name: '[a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*?' follow: '(?:(?<]+?' follow: '\h|\R|\{|\[|\$|\)|\(' UnNamedGroupingBracesBrackets: diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 77ae1fb829f..2c6dc044b8c 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.9, 2021-03-14 +# latexindent.pl, version 3.9.1, 2021-03-21 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3