diff options
author | Karl Berry <karl@freefriends.org> | 2024-04-28 20:06:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-04-28 20:06:53 +0000 |
commit | 5fba95dca8837c90f7d628e1370181814b9d5cd7 (patch) | |
tree | ff2c6b81ff1c3e83272f5e25f12b16e2dd9963cb /Master | |
parent | 8d220425254aa4d86b34c732a369be2abaafe091 (diff) |
latexindent (28apr24)
git-svn-id: svn://tug.org/texlive/trunk@71114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/bin/windows/latexindent.exe | bin | 9467855 -> 9468172 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/latexindent.pdf | bin | 1285520 -> 1297746 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/latexindent.tex | 132 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm | 5 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm | 24 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm | 44 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm | 15 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm | 23 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm | 4 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/latexindent/defaultSettings.yaml | 3 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/latexindent/latexindent.pl | 2 |
13 files changed, 203 insertions, 53 deletions
diff --git a/Master/bin/windows/latexindent.exe b/Master/bin/windows/latexindent.exe Binary files differindex 54c22ba9649..ee251774df0 100755 --- a/Master/bin/windows/latexindent.exe +++ b/Master/bin/windows/latexindent.exe diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README index 77bc3fb97f0..6b589faadfb 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.23.9, 2024-04-06 + latexindent.pl, version 3.24, 2024-04-28 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json b/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json index 56ffbc24091..397d577e927 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json +++ b/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json @@ -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.23.9 2024-04-06", + "description": "latexindent.pl YAML schema helper, V3.24 2024-04-28", "type": "object", "properties": { "fileExtensionPreference": { diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf Binary files differindex 03fb4d7bd1a..9555a30a140 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf +++ b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.tex b/Master/texmf-dist/doc/support/latexindent/latexindent.tex index da46a04f095..fc96a1db9a9 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent.tex +++ b/Master/texmf-dist/doc/support/latexindent/latexindent.tex @@ -415,121 +415,121 @@ \lstdefinestyle{indentAfterItems}{ style=yaml-LST, - firstnumber=241,linerange={241-248}, + firstnumber=242,linerange={242-249}, numbers=left, } \lstdefinestyle{itemNames}{ style=yaml-LST, - firstnumber=254,linerange={254-256}, + firstnumber=255,linerange={255-257}, numbers=left, } \lstdefinestyle{specialBeginEnd}{ style=yaml-LST, - firstnumber=260,linerange={260-274}, + firstnumber=261,linerange={261-275}, numbers=left, } \lstdefinestyle{indentAfterHeadings}{ style=yaml-LST, - firstnumber=284,linerange={284-293}, + firstnumber=285,linerange={285-294}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobalEnv}{ style=yaml-LST, - firstnumber=342,linerange={342-343}, + firstnumber=343,linerange={343-344}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobal}{ style=yaml-LST, - firstnumber=342,linerange={342-354}, + firstnumber=343,linerange={343-355}, numbers=left, } \lstdefinestyle{indentRulesGlobalEnv}{ style=yaml-LST, - firstnumber=358,linerange={358-359}, + firstnumber=359,linerange={359-360}, numbers=left, } \lstdefinestyle{indentRulesGlobal}{ style=yaml-LST, - firstnumber=358,linerange={358-370}, + firstnumber=359,linerange={359-371}, numbers=left, } \lstdefinestyle{commandCodeBlocks}{ style=yaml-LST, - firstnumber=373,linerange={373-388}, + firstnumber=374,linerange={374-389}, numbers=left, } \lstdefinestyle{modifylinebreaks}{ style=yaml-LST, - firstnumber=501,linerange={501-503}, + firstnumber=502,linerange={502-504}, numbers=left, } \lstdefinestyle{textWrapOptions}{ style=yaml-LST, - firstnumber=531,linerange={531-532}, + firstnumber=532,linerange={532-533}, numbers=left, } \lstdefinestyle{textWrapOptionsAll}{ style=yaml-LST, - firstnumber=531,linerange={531-558}, + firstnumber=532,linerange={532-559}, numbers=left, } \lstdefinestyle{oneSentencePerLine}{ style=yaml-LST, - firstnumber=504,linerange={504-530}, + firstnumber=505,linerange={505-531}, numbers=left, } \lstdefinestyle{sentencesFollow}{ style=yaml-LST, - firstnumber=510,linerange={510-518}, + firstnumber=511,linerange={511-519}, numbers=left, } \lstdefinestyle{sentencesBeginWith}{ style=yaml-LST, - firstnumber=519,linerange={519-522}, + firstnumber=520,linerange={520-523}, numbers=left, } \lstdefinestyle{sentencesEndWith}{ style=yaml-LST, - firstnumber=523,linerange={523-528}, + firstnumber=524,linerange={524-529}, numbers=left, } \lstdefinestyle{sentencesDoNOTcontain}{ style=yaml-LST, - firstnumber=529,linerange={529-530}, + firstnumber=530,linerange={530-531}, numbers=left, } \lstdefinestyle{modifylinebreaksEnv}{ style=yaml-LST, - firstnumber=560,linerange={560-569}, + firstnumber=561,linerange={561-570}, numbers=left, } \lstdefinestyle{replacements}{ style=yaml-LST, - firstnumber=621,linerange={621-626}, + firstnumber=622,linerange={622-627}, numbers=left, } \lstdefinestyle{fineTuning}{ style=yaml-LST, - firstnumber=630,linerange={630-685}, + firstnumber=631,linerange={631-686}, numbers=left, } @@ -1805,7 +1805,7 @@ latexindent.pl myfile.tex are detailed in \cref{app:indentconfig:options}. \announce{2023-01-01}{indentconfig location options} -\subsection{indentconfig.yaml and .indentconfig.yaml} +\subsection{indentconfig.yaml and .indentconfig.yaml}\label{subsec:indentconfig} \texttt{latexindent.pl} will always check your home directory for \texttt{indentconfig.yaml} and \texttt{.indentconfig.yaml} (unless it is called with the \texttt{-d} switch), which @@ -1860,6 +1860,11 @@ latexindent.pl myfile.tex \texttt{indent.log}. \end{warning} + As of \announce*{2024-04-28}{paths within local YAML settings} you can specify the + \texttt{paths} field from \cref{lst:indentconfig} within any of your + \texttt{latexindent.yaml} and friends settings files. This can lead to creative nesting + of configuration files; a demonstration is given in \vref{sec:appendix:paths}. + If you find that \announce{2021-06-19}{encoding option for indentconfig.yaml} \texttt{latexindent.pl} does not read your YAML file, then it might be as a result of the default commandline encoding not being UTF-8; normally this will only occur for @@ -1968,6 +1973,9 @@ latexindent.pl -l=mysettings.yaml -y="verbatimEnvironments:cmhenvironment:0;myen latexindent.pl -m --yaml='modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\;' \end{commandshell} + Note that the \texttt{paths} settings (see \vref{sec:appendix:paths}) can \emph{not} be + specified using the \texttt{-y} switch. + \subsection{Settings load order}\label{sec:loadorder} \texttt{latexindent.pl} loads the settings files in the following order: \index{switches!-l in relation to other settings} @@ -3265,7 +3273,7 @@ latexindent.pl special2.tex -l=middle1 For example, let’s consider the \texttt{.tex} file in \cref{lst:specialAlgo}. \index{specialBeginEnd!middle} \index{specialBeginEnd!Algorithms example} - \cmhlistingsfromfile*[basicstyle=\tiny]{demonstrations/specialAlgo.tex}[enhanced jigsaw,breakable]{\texttt{specialAlgo.tex}}{lst:specialAlgo} + \cmhlistingsfromfile[basicstyle=\tiny]{demonstrations/specialAlgo.tex}[enhanced jigsaw,breakable]{\texttt{specialAlgo.tex}}{lst:specialAlgo} Upon saving the YAML settings in \cref{lst:algo-yaml} and running the command \index{switches!-l demonstration} @@ -3277,8 +3285,8 @@ latexindent.pl -l=algo.yaml specialAlgo.tex then we obtain the output given in \cref{lst:specialAlgo-mod1}. \begin{cmhtcbraster} - \cmhlistingsfromfile*[basicstyle=\tiny]{demonstrations/specialAlgo-mod1.tex}{\texttt{specialAlgo.tex} using \cref{lst:algo-yaml}}{lst:specialAlgo-mod1} - \cmhlistingsfromfile*[style=yaml-LST,basicstyle=\tiny,commentstyle=\color{blue}\ttfamily\tiny]{demonstrations/algo.yaml}[yaml-TCB]{\texttt{algo.yaml}}{lst:algo-yaml} + \cmhlistingsfromfile[basicstyle=\tiny]{demonstrations/specialAlgo-mod1.tex}{\texttt{specialAlgo.tex} using \cref{lst:algo-yaml}}{lst:specialAlgo-mod1} + \cmhlistingsfromfile[style=yaml-LST,basicstyle=\tiny,commentstyle=\color{blue}\ttfamily\tiny]{demonstrations/algo.yaml}[yaml-TCB]{\texttt{algo.yaml}}{lst:algo-yaml} \end{cmhtcbraster} \end{example} @@ -8414,10 +8422,10 @@ latexindent.pl finetuning5.tex -l=fine-tuning3.yaml We can use the \texttt{fineTuning} settings to tweak how \texttt{latexindent.pl} finds environments. - We begin with the file in \cref{lst:finetuning6}.\announce*{2023-10-13}{fineTuning + We begin with the file in \cref{lst:finetuning6}.\announce{2023-10-13}{fineTuning environments} - \cmhlistingsfromfile*{demonstrations/finetuning6.tex}{\texttt{finetuning6.tex}}{lst:finetuning6} + \cmhlistingsfromfile{demonstrations/finetuning6.tex}{\texttt{finetuning6.tex}}{lst:finetuning6} Using the settings in \cref{lst:fine-tuning4} and running the command @@ -8433,8 +8441,8 @@ latexindent.pl finetuning6.tex -m -l=fine-tuning4.yaml raster column 1/.style={add to width=-.1\textwidth}, raster column 2/.style={add to width=-.3\textwidth}, ] - \cmhlistingsfromfile*{demonstrations/finetuning6-mod1.tex}{\texttt{finetuning6-mod1.tex}}{lst:finetuning6-mod1} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/fine-tuning4.yaml}[MLB-TCB]{\texttt{fine-tuning4.yaml}}{lst:fine-tuning4} + \cmhlistingsfromfile{demonstrations/finetuning6-mod1.tex}{\texttt{finetuning6-mod1.tex}}{lst:finetuning6-mod1} + \cmhlistingsfromfile[style=yaml-LST]{demonstrations/fine-tuning4.yaml}[MLB-TCB]{\texttt{fine-tuning4.yaml}}{lst:fine-tuning4} \end{cmhtcbraster} By using the settings in \cref{lst:fine-tuning4} it means that the default poly-switch @@ -9307,6 +9315,74 @@ echo 'export LATEXINDENT_CONFIG="/your/config/path"' >> ~/.profile stored in \texttt{\$HOME/.profile}). All commands in this file a run after login, so the environment variable will be set after your next login. + \section{paths demonstration}\label{sec:appendix:paths} + + As detailed in \vref{subsec:indentconfig} \announce*{2024-04-28}{nested paths + demonstration}, the \texttt{paths} field can be specified in any of your \texttt{YAML} + files. + + We will use the file in \cref{lst:paths-demo} for demonstration in what follows. + + \cmhlistingsfromfile*{demonstrations/paths-demo.tex}{\texttt{paths-demo.tex}}{lst:paths-demo} + + \begin{example} + Consider the settings given in \cref{lst:path1-yaml} and \cref{lst:path2-yaml}. + + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/path1.yaml}[yaml-TCB]{\texttt{path1.yaml}}{lst:path1-yaml} + \cmhlistingsfromfile*[style=yaml-LST,showspaces=true]{demonstrations/path2.yaml}[yaml-TCB]{\texttt{path2.yaml}}{lst:path2-yaml} + \end{cmhtcbraster} + + Upon calling + + \begin{commandshell} +latexindent.pl -l=path1.yaml paths-demo.tex +\end{commandshell} + + then we will receive the output given in \cref{lst:paths-demo-mod1}. + + \cmhlistingsfromfile*[showspaces=true]{demonstrations/paths-demo-mod1.tex}{\texttt{paths-demo-mod1.tex}}{lst:paths-demo-mod1} + + We note that the settings from \cref{lst:path2-yaml} have been called from + \cref{lst:path1-yaml}. + + On inspection of \texttt{indent.log} from the above call, we see the details of this + part of the process given in \cref{lst:path-test1:txt}. + + \cmhlistingsfromfile*{demonstrations/path-test1.txt}{\texttt{path-test1.txt}}{lst:path-test1:txt} + \end{example} + + \begin{example} + Consider the settings given in \cref{lst:path3-yaml} to \cref{lst:path5-yaml}. + + \begin{cmhtcbraster}[raster columns=3, + raster left skip=-3.5cm, + raster right skip=-2cm, + raster column skip=.03\linewidth] + \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/path3.yaml}[yaml-TCB]{\texttt{path3.yaml}}{lst:path3-yaml} + \cmhlistingsfromfile*[style=yaml-LST,showspaces=true]{demonstrations/path4.yaml}[yaml-TCB]{\texttt{path4.yaml}}{lst:path4-yaml} + \cmhlistingsfromfile*[style=yaml-LST,showspaces=true]{demonstrations/path5.yaml}[yaml-TCB]{\texttt{path5.yaml}}{lst:path5-yaml} + \end{cmhtcbraster} + + Upon calling + + \begin{commandshell} +latexindent.pl -l=path3.yaml paths-demo.tex +\end{commandshell} + + then we will receive the output given in \cref{lst:paths-demo-mod3}. + + \cmhlistingsfromfile*[showspaces=true]{demonstrations/paths-demo-mod3.tex}{\texttt{paths-demo-mod3.tex}}{lst:paths-demo-mod3} + + We see that \texttt{path3.yaml} calls \texttt{path4.yaml} which in turn calls + \texttt{path5.yaml}. + + On inspection of \texttt{indent.log} from the above call, we see the details of this + part of the process given in \cref{lst:path-test3:txt}. + + \cmhlistingsfromfile*{demonstrations/path-test3.txt}{\texttt{path-test3.txt}}{lst:path-test3:txt} + \end{example} + \section{logFilePreferences}\label{app:logfile-demo} \Vref{lst:logFilePreferences} describes the options for customising the information given to the log file, and we provide a few demonstrations here. diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm index f88304fc6cf..cba84352114 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -54,6 +54,11 @@ sub create_back_up_file { # add the user's backup directory to the backup path $backupFileNoExt = "${$self}{cruftDirectory}/$backupFileNoExt"; + $backupFileNoExt =~ s/\\/\//g; + $backupFileNoExt =~ s/\/{2,}/\//g; + if ( $^O eq 'MSWin32' ) { + $backupFileNoExt =~ s/\//\\/g; + } # local variables, determined from the YAML settings my $onlyOneBackUp = $mainSettings{onlyOneBackUp}; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm index b35795f70a5..477c5da68f7 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm @@ -272,12 +272,19 @@ sub output_logfile { if ${ $mainSettings{logFilePreferences} }{showGitHubInfoFooter}; # open log file - my $logfileName = $switches{logFileName} || "indent.log"; - my $logfilePossible = 1; - my $logfile = open_with_encode( '>:encoding(UTF-8)', "${$self}{cruftDirectory}/$logfileName" ) - or $logfilePossible = 0; + my $logfileName = $switches{logFileName} || "indent.log"; + + my $logfilePath; + $logfilePath = "${$self}{cruftDirectory}/$logfileName"; + $logfilePath =~ s/\\/\//g; + $logfilePath =~ s/\/{2,}/\//g; + if ( $^O eq 'MSWin32' ) { + $logfilePath =~ s/\//\\/g; + } + + my $logfile = open_with_encode( '>:encoding(UTF-8)', $logfilePath ); - if ($logfilePossible) { + if ($logfile) { foreach my $line ( @{LatexIndent::Logger::logFileLines} ) { print $logfile $line, "\n"; } @@ -285,7 +292,12 @@ sub output_logfile { # close log file close($logfile); } - + else { + if ( $switches{screenlog} ) { + print "WARN: Could not open the logfile $logfilePath \n"; + print " No logfile will be produced.\n"; + } + } } sub process_body_of_text { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index 9e5ff7a8538..4d4940371d8 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -382,6 +382,46 @@ sub yaml_read_settings { $logger->info("Reading USER settings from $settings"); $userSettings = read_yaml_with_encode("$settings"); + # update the absolute paths + if ( $userSettings and ( ref( $userSettings->[0] ) eq 'HASH' ) and $userSettings->[0]->{paths} ) { + $logger->info("Reading path information from $settings"); + + # output the contents of indentconfig to the log file + $logger->info( Dump \%{ $userSettings->[0] } ); + + # change the encoding of the paths according to the field `encoding` + if ( $userSettings and ( ref( $userSettings->[0] ) eq 'HASH' ) and $userSettings->[0]->{encoding} ) { + use Encode; + my $encoding = $userSettings->[0]->{encoding}; + my $encodingObject = find_encoding($encoding); + + # Check if the encoding is valid. + if ( ref($encodingObject) ) { + $logger->info("*Encoding of the paths is $encoding"); + foreach ( @{ $userSettings->[0]->{paths} } ) { + my $temp = $encodingObject->encode("$_"); + $logger->info("Transform file encoding: $_ -> $temp"); + push( @absPaths, $temp ); + } + } + else { + $logger->warn("*encoding \"$encoding\" not found"); + $logger->warn("Ignore this setting and will take the default encoding."); + @absPaths = @{ $userSettings->[0]->{paths} }; + foreach ( @{ $userSettings->[0]->{paths} } ) { + push( @absPaths, $_ ); + } + } + } + else # No such setting, and will take the default + { + # $logger->info("*Encoding of the paths takes the default."); + foreach ( @{ $userSettings->[0]->{paths} } ) { + push( @absPaths, $_ ); + } + } + } + # if we can read userSettings if ($userSettings) { @@ -477,7 +517,9 @@ sub yaml_read_settings { } # if amalgamate is set to 1, then append - if ( ${ $mainSettings{$firstLevelKey}[0] }{amalgamate} ) { + if ( ref( $mainSettings{$firstLevelKey}[0] ) eq "HASH" + and ${ $mainSettings{$firstLevelKey}[0] }{amalgamate} ) + { # loop through the other settings foreach ( @{$firstLevelValue} ) { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm index 7418f1024ca..da0c86af2a4 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm @@ -135,6 +135,11 @@ ENDQUOTE # cruft directory ${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} ); + ${$self}{cruftDirectory} =~ s/\\/\//g; + ${$self}{cruftDirectory} =~ s/\/{2,}/\//g; + if ( $^O eq 'MSWin32' ) { + ${$self}{cruftDirectory} =~ s/\//\\/g; + } my $cruftDirectoryCreation = 0; @@ -149,11 +154,13 @@ ENDQUOTE } $cruftDirectoryCreation = 1; } - my $logfileName = ( $switches{cruftDirectory} ? ${$self}{cruftDirectory} . "/" : '' ) . ( $switches{logFileName} || "indent.log" ); - - $logfileName = $logfileName; + $logfileName =~ s/\\/\//g; + $logfileName =~ s/\/{2,}/\//g; + if ( $^O eq 'MSWin32' ) { + $logfileName =~ s/\//\\/g; + } # details of the script to log file $logger->info("*$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files"); @@ -260,7 +267,7 @@ ENDQUOTE $switches{outputToFile} = 0; } - $logger->info("*Directory for backup files and $logfileName:"); + $logger->info("*Directory for backup files and log file $logfileName:"); $logger->info( $switches{cruftDirectory} ? ${$self}{cruftDirectory} : ${$self}{cruftDirectory} ); $logger->info("cruft directory creation: ${$self}{cruftDirectory}") if $cruftDirectoryCreation; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm index a2ba0b1d2f7..45a2b6f5385 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm @@ -66,12 +66,20 @@ sub open_with_encode { require Win32::Unicode::File; Win32::Unicode::File->import; $fh = Win32::Unicode::File->new; - open $fh, $mode, $filename or die "Can't open file: $!"; - return $fh; + if ( open $fh, $mode, $filename ) { + return $fh; + } + else { + return undef; + } } else { - open( $fh, $mode, $filename ) or die "Can't open file: $!"; - return $fh; + if ( open( $fh, $mode, $filename ) ) { + return $fh; + } + else { + return undef; + } } } @@ -79,7 +87,7 @@ sub read_yaml_with_encode { use YAML::Tiny; my $filename = shift; - my $fh = open_with_encode( '<:encoding(UTF-8)', $filename ) or die $!; + my $fh = open_with_encode( '<:encoding(UTF-8)', $filename ) or return undef; my $yaml_string = join( "", <$fh> ); return YAML::Tiny->read_string($yaml_string); } @@ -105,14 +113,13 @@ sub mkdir_with_encode { require Win32::Unicode::Dir; Win32::Unicode::Dir->import(qw(mkdirW)); - mkdirW($path) or die "Cannot create directory $path: $!"; + mkdirW($path); } else { require File::Path; File::Path->import(qw(make_path)); - my $created = make_path($path); - die "Cannot create directory $path" unless $created; + make_path($path); } } diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index bbfb2e7ea38..b42ea7bdaf2 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.23.9'; -our $versionDate = '2024-04-06'; +our $versionNumber = '3.24'; +our $versionDate = '2024-04-28'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 257216f6bdb..1d281dd7fa0 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,5 +1,5 @@ # -# latexindent.pl, version 3.23.9, 2024-04-06 +# latexindent.pl, version 3.24, 2024-04-28 # # defaultSettings.yaml, the default settings for latexindent.pl # @@ -228,6 +228,7 @@ lookForAlignDelims: tblr: 1 longtblr: 1 talltblr: 1 + spreadtab: 1 # if you want the script to look for \item commands # and format it, as follows (for example), diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 194b1305952..2c2232a046e 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# latexindent.pl, version 3.23.9, 2024-04-06 +# latexindent.pl, version 3.24, 2024-04-28 # # 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 |