texlive[67628] trunk: latexindent (14jul23)
commits+karl at tug.org
commits+karl at tug.org
Fri Jul 14 23:03:52 CEST 2023
Revision: 67628
http://tug.org/svn/texlive?view=revision&revision=67628
Author: karl
Date: 2023-07-14 23:03:52 +0200 (Fri, 14 Jul 2023)
Log Message:
-----------
latexindent (14jul23)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
trunk/Master/bin/windows/latexindent.exe
trunk/Master/texmf-dist/doc/support/latexindent/README
trunk/Master/texmf-dist/doc/support/latexindent/contributors.bib
trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json
trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.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/Master/bin/windows/latexindent.exe
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README 2023-07-14 21:03:52 UTC (rev 67628)
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.22.1, 2023-07-02
+ latexindent.pl, version 3.22.2, 2023-07-14
PERL script to indent code within environments, and align delimited
environments in .tex files.
Modified: trunk/Master/texmf-dist/doc/support/latexindent/contributors.bib
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/contributors.bib 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/doc/support/latexindent/contributors.bib 2023-07-14 21:03:52 UTC (rev 67628)
@@ -217,3 +217,10 @@
urldate = {2023-05-25},
keywords = {contributor},}
+ at online{jessestricker,
+ title = "Create cruft directory if it does not exist",
+ url = "https://github.com/cmhughes/latexindent.pl/pull/453",
+ date = {2023-07-12},
+ author = "Jesse Stricker",
+ urldate = {2023-07-12},
+ keywords = {contributor},}
Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json 2023-07-14 21:03:52 UTC (rev 67628)
@@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "latexindent-yaml-schema.json",
"title": "latexindent.pl YAML schema",
- "description": "latexindent.pl YAML schema helper, V3.22.1 2023-07-02",
+ "description": "latexindent.pl YAML schema helper, V3.22.2 2023-07-14",
"type": "object",
"properties": {
"fileExtensionPreference": {
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 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex 2023-07-14 21:03:52 UTC (rev 67628)
@@ -1559,6 +1559,9 @@
than the current working directory, then you can send these `cruft' files to another
directory. Note the use of a trailing forward slash. % this switch was made as a result of http://tex.stackexchange.com/questions/142652/output-latexindent-auxiliary-files-to-a-different-directory
+ If the cruft directory does not exist, \texttt{latexindent.pl} will attempt to create
+ it.
+
\flagbox{-g, --logfile=<name of log file>}
\index{switches!-g, --logfile definition and details}
@@ -1781,7 +1784,7 @@
3 & \faClose & failure, myfile.tex not found \\
4 & \faClose & failure, myfile.tex exists but cannot be read \\
5 & \faClose & failure, \texttt{-w} active, and back-up file cannot be written \\
- 6 & \faClose & failure, \texttt{-c} active, and cruft directory does not exist \\
+ 6 & \faClose & failure, \texttt{-c} active, and cruft directory could not be created \\
\bottomrule
\end{tabular}
\end{table}
@@ -8359,6 +8362,7 @@
use FindBin; # |
use File::Copy; # |
use File::Basename; # |
+use File::Path; # |
use File::HomeDir; # <--- typically requires install via cpanm
use YAML::Tiny; # <--- typically requires install via cpanm
Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm 2023-07-14 21:03:52 UTC (rev 67628)
@@ -142,4 +142,8 @@
return;
}
+sub modify_line_breaks_end {
+ return;
+}
+
1;
Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm 2023-07-14 21:03:52 UTC (rev 67628)
@@ -19,6 +19,7 @@
use warnings;
use FindBin;
use File::Basename; # to get the filename and directory path
+use File::Path qw(make_path);
use Exporter qw/import/;
use LatexIndent::Switches qw/%switches/;
use LatexIndent::Version qw/$versionNumber $versionDate/;
@@ -129,12 +130,18 @@
# cruft directory
${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} );
- # if cruft directory does not exist
+ my $cruftDirectoryCreation = 0;
+
+ # if cruft directory does not exist, create it
if ( !( -d ${$self}{cruftDirectory} ) ) {
- $logger->fatal( "*Could not find directory " . decode( "utf-8", ${$self}{cruftDirectory} ) );
- $logger->fatal("Exiting, no indentation done.");
- $self->output_logfile();
- exit(6);
+ eval { make_path( ${$self}{cruftDirectory} ) };
+ if ($@) {
+ $logger->fatal( "*Could not create cruft directory " . decode( "utf-8", ${$self}{cruftDirectory} ) );
+ $logger->fatal("Exiting, no indentation done.");
+ $self->output_logfile();
+ exit(6);
+ }
+ $cruftDirectoryCreation = 1;
}
my $logfileName = ( $switches{cruftDirectory} ? ${$self}{cruftDirectory} . "/" : '' )
@@ -247,6 +254,7 @@
$logger->info("*Directory for backup files and $logfileName:");
$logger->info( $switches{cruftDirectory} ? decode( "utf-8", ${$self}{cruftDirectory} ) : ${$self}{cruftDirectory} );
+ $logger->info("cruft directory creation: ${$self}{cruftDirectory}") if $cruftDirectoryCreation;
# output location of modules
if ( $FindBin::Script eq 'latexindent.pl' or ( $FindBin::Script eq 'latexindent.exe' and $switches{trace} ) ) {
Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm 2023-07-14 21:03:52 UTC (rev 67628)
@@ -20,6 +20,6 @@
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;
-our $versionNumber = '3.22.1';
-our $versionDate = '2023-07-02';
+our $versionNumber = '3.22.2';
+our $versionDate = '2023-07-14';
1
Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm 2023-07-14 21:03:52 UTC (rev 67628)
@@ -41,6 +41,8 @@
my $blocksFollow = q();
my $blocksFollowHash = \%{ ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{blocksFollow} };
+ my $headingsRegEx = q();
+
foreach my $blocksFollowEachPart ( sort keys %{$blocksFollowHash} ) {
last if ${$self}{modifyLineBreaksYamlName} eq 'sentence';
@@ -90,6 +92,9 @@
#
$headingName = qr/\\$headingName\h*(?:\[[^]]*?\])?\h*\{[^}]*?\}\h*(?:\\label\{[^}]*?\})?/m;
+ # stored for possible use with 'after'
+ $headingsRegEx = $headingName . ( $headingsRegEx eq '' ? q() : "|$headingsRegEx" );
+
# put starred headings at the front of the regexp
if ( $headingName =~ m/\*/ ) {
$blocksFollowEachPart
@@ -332,8 +337,9 @@
else {
my $thingToMeasure = ( split( /\R/, $textWrapBlockStorage[ $textWrapBlockCount - 1 ] ) )[-1];
$thingToMeasure =~ s/$tokens{blanklines}//;
- $thingToMeasure =~ s/$tokens{verbatim}//;
+ $thingToMeasure =~ s/$tokens{verbatim}\d+$tokens{endOfToken}//;
$thingToMeasure =~ s/$trailingCommentRegExp//;
+ $thingToMeasure =~ s/$headingsRegEx//;
$subsequentSpace = (
$textWrapBlockCount == 0
Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml 2023-07-14 15:52:29 UTC (rev 67627)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml 2023-07-14 21:03:52 UTC (rev 67628)
@@ -1,5 +1,5 @@
#
-# latexindent.pl, version 3.22.1, 2023-07-02
+# latexindent.pl, version 3.22.2, 2023-07-14
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
Modified: trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)
More information about the tex-live-commits
mailing list.