diff options
author | Norbert Preining <norbert@preining.info> | 2023-01-08 03:01:28 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-01-08 03:01:28 +0000 |
commit | 7d5553601ccc6f3feed4f9563a6270739bd4da54 (patch) | |
tree | 5439910db3631d3200f0f7df70e3d8707ab146cf /support/latexindent/LatexIndent | |
parent | c946b2e792715f6030486d5214be1df081de37a8 (diff) |
CTAN sync 202301080301
Diffstat (limited to 'support/latexindent/LatexIndent')
19 files changed, 47 insertions, 43 deletions
diff --git a/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm b/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm index 746041893d..0cdfad7dd8 100644 --- a/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm +++ b/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm @@ -1692,7 +1692,7 @@ sub get_column_width { return $count; } - # if GCString actice, then use Unicode::GCString + # if GCString active, then use Unicode::GCString return Unicode::GCString->new($stringToBeMeasured)->columns(); } 1; diff --git a/support/latexindent/LatexIndent/BackUpFileProcedure.pm b/support/latexindent/LatexIndent/BackUpFileProcedure.pm index 369f06d075..82d1a81653 100644 --- a/support/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/support/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -119,7 +119,7 @@ sub create_back_up_file { if ( $backUpFilePossible == 0 ) { $logger->fatal( "*Could not write to backup file $backupFile. Please check permissions. Exiting."); - $logger->fatal("Exiting, no indendation done."); + $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(5); } @@ -150,7 +150,7 @@ sub create_back_up_file { copy( $fileName, $backupFile ) or ( $backUpFilePossible = 0 ); if ( $backUpFilePossible == 0 ) { $logger->fatal("*Could not write to backup file $backupFile. Please check permissions."); - $logger->fatal("Exiting, no indendation done."); + $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(5); } diff --git a/support/latexindent/LatexIndent/Command.pm b/support/latexindent/LatexIndent/Command.pm index e919f33d11..9e2a677a1b 100644 --- a/support/latexindent/LatexIndent/Command.pm +++ b/support/latexindent/LatexIndent/Command.pm @@ -33,7 +33,7 @@ our $commandRegExpTrailingComment; our $optAndMandAndRoundBracketsRegExp; our $optAndMandAndRoundBracketsRegExpLineBreaks; -# store the regular expresssion for matching and replacing +# store the regular expression for matching and replacing sub construct_command_regexp { my $self = shift; @@ -205,7 +205,7 @@ sub tasks_particular_to_each_object { and ${$self}{replacementText} !~ m/\R$/ ) { $logger->trace( - "${$self}{name}: trailling horizontal space found in arguments -- removing it from arguments, adding to replacement text" + "${$self}{name}: trailing horizontal space found in arguments -- removing it from arguments, adding to replacement text" ) if $is_t_switch_active; ${ ${ ${$self}{children} }[0] }{body} =~ s/(\h*)$//s; ${$self}{replacementText} .= "$1"; diff --git a/support/latexindent/LatexIndent/Else.pm b/support/latexindent/LatexIndent/Else.pm index 54de7808c4..da6005e7a6 100644 --- a/support/latexindent/LatexIndent/Else.pm +++ b/support/latexindent/LatexIndent/Else.pm @@ -35,7 +35,7 @@ sub check_for_else_statement { # we call the else routine from different places; see IfElseFi.pm and Special.pm my %input = @_; - # store the regular expresssion for matching and replacing the \else statements + # store the regular expression for matching and replacing the \else statements my $elseRegExp = qr/ ( $input{elseNameRegExp} diff --git a/support/latexindent/LatexIndent/Environment.pm b/support/latexindent/LatexIndent/Environment.pm index 9cb9850d2b..9d2c34d1bd 100644 --- a/support/latexindent/LatexIndent/Environment.pm +++ b/support/latexindent/LatexIndent/Environment.pm @@ -33,7 +33,7 @@ our $environmentCounter; our $environmentBasicRegExp = qr/\\begin\{/; our $environmentRegExp; -# store the regular expresssion for matching and replacing the \begin{}...\end{} statements +# store the regular expression for matching and replacing the \begin{}...\end{} statements sub construct_environments_regexp { # read from fine tuning diff --git a/support/latexindent/LatexIndent/FileExtension.pm b/support/latexindent/LatexIndent/FileExtension.pm index 8b01fa9e29..b0f49f246d 100644 --- a/support/latexindent/LatexIndent/FileExtension.pm +++ b/support/latexindent/LatexIndent/FileExtension.pm @@ -72,7 +72,7 @@ sub file_extension_check { if ( defined ${$self}{multipleFiles} ) { $logger->warn( "*I couldn't find a match for $fileName in fileExtensionPreference (see defaultSettings.yaml)"); - $logger->warn("moving on, no indendation done for ${$self}{fileName}."); + $logger->warn("moving on, no indentation done for ${$self}{fileName}."); return 3; } else { @@ -82,7 +82,7 @@ sub file_extension_check { $logger->fatal("I searched for $fileName$_"); } $logger->fatal("but couldn't find any of them.\nConsider updating fileExtensionPreference."); - $logger->fatal("*Exiting, no indendation done."); + $logger->fatal("*Exiting, no indentation done."); $self->output_logfile(); exit(3); } @@ -93,12 +93,12 @@ sub file_extension_check { unless ( -e $fileName ) { if ( defined ${$self}{multipleFiles} ) { $logger->warn("*I couldn't find $fileName, are you sure it exists?"); - $logger->warn("moving on, no indendation done for ${$self}{fileName}."); + $logger->warn("moving on, no indentation done for ${$self}{fileName}."); return 3; } else { $logger->fatal("*I couldn't find $fileName, are you sure it exists?"); - $logger->fatal("Exiting, no indendation done."); + $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(3); } @@ -171,12 +171,12 @@ sub file_extension_check { if ( $openFilePossible == 0 ) { if ( defined ${$self}{multipleFiles} ) { $logger->warn("*$fileName exists, but could not open it"); - $logger->warn("moving on, no indendation done for $fileName"); + $logger->warn("moving on, no indentation done for $fileName"); return 4; } else { $logger->fatal("*$fileName exists, but could not open it"); - $logger->fatal("Exiting, no indendation done."); + $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(4); } diff --git a/support/latexindent/LatexIndent/GetYamlSettings.pm b/support/latexindent/LatexIndent/GetYamlSettings.pm index a5931d17f7..11a18c171f 100644 --- a/support/latexindent/LatexIndent/GetYamlSettings.pm +++ b/support/latexindent/LatexIndent/GetYamlSettings.pm @@ -145,7 +145,7 @@ sub yaml_read_settings { elsif ( -f "$homeDir/.config/latexindent/indentconfig.yaml" ) { $indentconfig = "$homeDir/.config/latexindent/indentconfig.yaml"; $logger->info( - 'The config file in "' . "$homeDir/.config/latexindent/indentconfig.yaml" . '" was recognized' ); + 'The config file in "' . "$homeDir/.config/latexindent/indentconfig.yaml" . '" will be read' ); } } elsif ( $^O eq "darwin" ) { @@ -153,7 +153,7 @@ sub yaml_read_settings { $indentconfig = "$homeDir/Library/Preferences/latexindent/indentconfig.yaml"; $logger->info( 'The config file in "' . "$homeDir/Library/Preferences/latexindent/indentconfig.yaml" - . '" was recognized' ); + . '" will be read' ); } } elsif ( $^O eq "MSWin32" || $^O eq "cygwin" ) { @@ -168,7 +168,7 @@ sub yaml_read_settings { $indentconfig = "$homeDir/AppData/Local/latexindent/indentconfig.yaml"; $logger->info( 'The config file in "' . "$homeDir" - . '\AppData\Local\latexindent\indentconfig.yaml" was recognized' ); + . '\AppData\Local\latexindent\indentconfig.yaml" will be read' ); } } @@ -179,13 +179,15 @@ sub yaml_read_settings { $indentconfig = ( -f "$homeDir/indentconfig.yaml" ) ? "$homeDir/indentconfig.yaml" : undef; # if indentconfig.yaml doesn't exist, check for the hidden file, .indentconfig.yaml - $indentconfig = ( -f "$homeDir/.indentconfig.yaml" ) ? "$homeDir/.indentconfig.yaml" : undef; - $logger->info( 'The config file in "' . "$indentconfig" . '" was recognized' ) if defined $indentconfig; + if ( !defined $indentconfig ) { + $indentconfig = ( -f "$homeDir/.indentconfig.yaml" ) ? "$homeDir/.indentconfig.yaml" : undef; + } + $logger->info( 'The config file in "' . "$indentconfig" . '" will be read' ) if defined $indentconfig; } } # messages for indentconfig.yaml and/or .indentconfig.yaml - if ( defined $indentconfig && -f $indentconfig && !$switches{onlyDefault} ) { + if ( defined $indentconfig and -f $indentconfig and !$switches{onlyDefault} ) { # read the absolute paths from indentconfig.yaml $userSettings = YAML::Tiny->read("$indentconfig"); @@ -246,8 +248,10 @@ sub yaml_read_settings { } else { # give the user instructions on where to put the config file + $logger->info("Home directory is $homeDir"); + $logger->info("latexindent.pl didn't find indentconfig.yaml or .indentconfig.yaml"); $logger->info( - "Home directory is $homeDir (didn't find a config file, see all posible locations here: https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#indentconfig-options)" + "see all possible locations: https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#indentconfig-options)" ); } } @@ -371,7 +375,7 @@ sub yaml_read_settings { # if we can read userSettings if ($userSettings) { - # update the MASTER setttings to include updates from the userSettings + # update the MASTER settings to include updates from the userSettings while ( my ( $firstLevelKey, $firstLevelValue ) = each %{ $userSettings->[0] } ) { # the update approach is slightly different for hashes vs scalars/arrays diff --git a/support/latexindent/LatexIndent/HiddenChildren.pm b/support/latexindent/LatexIndent/HiddenChildren.pm index 9c01d9b65b..aec7cd365e 100644 --- a/support/latexindent/LatexIndent/HiddenChildren.pm +++ b/support/latexindent/LatexIndent/HiddenChildren.pm @@ -48,7 +48,7 @@ our %allChildren; # \end{one} # # From the visual perspective, we might say that <one> and <two> are *nested* children; -# from the persepective of latexindent.pl, however, they actually have *the same level*. +# from the perspective of latexindent.pl, however, they actually have *the same level*. # # Graphically, you might represent it as follows # diff --git a/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm b/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm index 3ca67433a8..9582eeb6c5 100644 --- a/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm +++ b/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm @@ -48,7 +48,7 @@ sub remove_trailing_whitespace { $logger->trace("removeTrailingWhitespace: afterProcessing is now $removeTWS") if $is_t_switch_active; } - # this method can be called before the indendation, and after, depending upon the input + # this method can be called before the indentation, and after, depending upon the input if ( $input{when} eq "before" ) { return unless ( ${ $mainSettings{removeTrailingWhitespace} }{beforeProcessing} ); $logger->trace( diff --git a/support/latexindent/LatexIndent/IfElseFi.pm b/support/latexindent/LatexIndent/IfElseFi.pm index 22b3d2eb0f..ad7237240b 100644 --- a/support/latexindent/LatexIndent/IfElseFi.pm +++ b/support/latexindent/LatexIndent/IfElseFi.pm @@ -30,8 +30,8 @@ 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 +# store the regular expression 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 manageable sub construct_ifelsefi_regexp { my $ifElseFiNameRegExp = qr/${${$mainSettings{fineTuning}}{ifElseFi}}{name}/; diff --git a/support/latexindent/LatexIndent/Indent.pm b/support/latexindent/LatexIndent/Indent.pm index 404b4bca5b..51f5906cb3 100644 --- a/support/latexindent/LatexIndent/Indent.pm +++ b/support/latexindent/LatexIndent/Indent.pm @@ -137,7 +137,7 @@ sub indent_body { and ${$self}{removeParagraphLineBreaks} and !${ $mainSettings{modifyLineBreaks}{removeParagraphLineBreaks} }{beforeTextWrap} ); - # body indendation + # body indentation if ( ${$self}{linebreaksAtEnd}{begin} == 1 ) { if ( ${$self}{body} =~ m/^\h*$/s ) { $logger->trace("Body of ${$self}{name} is empty, not applying indentation") if $is_t_switch_active; diff --git a/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm b/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm index 684146e2f4..873a04adbe 100644 --- a/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm +++ b/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm @@ -44,7 +44,7 @@ sub construct_key_equals_values_regexp { my $keyEqualsValuesBracesBracketsFollow = qr/${${$mainSettings{fineTuning}}{keyEqualsValuesBracesBrackets}}{follow}/; - # store the regular expresssion for matching and replacing + # store the regular expression for matching and replacing $key_equals_values_bracesRegExp = qr/ ( (?:$keyEqualsValuesBracesBracketsFollow) @@ -122,7 +122,7 @@ sub create_unique_id { sub get_replacement_text { my $self = shift; - # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof +# the replacement text for a key = {value} needes to accommodate the leading [ OR { OR % OR , OR any combination thereof $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{beginningbit} . ${$self}{id}; delete ${$self}{beginningbit}; diff --git a/support/latexindent/LatexIndent/Lines.pm b/support/latexindent/LatexIndent/Lines.pm index e2085b735d..f0510cac1f 100644 --- a/support/latexindent/LatexIndent/Lines.pm +++ b/support/latexindent/LatexIndent/Lines.pm @@ -36,7 +36,7 @@ sub lines_body_selected_lines { $logger->info("*-n,--lines switch is active, operating on lines $switches{lines}"); $logger->info( "number of lines in file: " . ( $#lines + 1 ) ); - $logger->info("*interpretting $switches{lines}"); + $logger->info("*interpreting $switches{lines}"); my @lineRanges = split( /,/, $switches{lines} ); my @indentLineRange; @@ -187,7 +187,7 @@ sub lines_sort_and_combine_line_range { # # --lines 8-10,4-5,1-2 # - # needs to be interpretted as + # needs to be interpreted as # # --lines 1-2,4-5,8-10, # @@ -212,7 +212,7 @@ sub lines_sort_and_combine_line_range { # # --lines 3-5,4-10 # - # needs to be interpretted as + # needs to be interpreted as # # --lines 3-10 # @@ -230,7 +230,7 @@ sub lines_sort_and_combine_line_range { # # --lines 3-7,4-6 # - # needs to be interpretted as + # needs to be interpreted as # # --lines 3-7 # diff --git a/support/latexindent/LatexIndent/LogFile.pm b/support/latexindent/LatexIndent/LogFile.pm index cd6ec912c3..809aa71d2d 100644 --- a/support/latexindent/LatexIndent/LogFile.pm +++ b/support/latexindent/LatexIndent/LogFile.pm @@ -131,7 +131,7 @@ ENDQUOTE # if cruft directory does not exist if ( !( -d ${$self}{cruftDirectory} ) ) { $logger->fatal("*Could not find directory ${$self}{cruftDirectory}"); - $logger->fatal("Exiting, no indendation done."); + $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(6); } @@ -238,7 +238,7 @@ ENDQUOTE if ( ( scalar @fileNames > 1 ) and $switches{outputToFile} and ( $switches{outputToFile} !~ m/^h*\+/ ) ) { $logger->warn("*-o switch specified as single file, but multiple files given as input"); $logger->warn("ignoring your specification -o $switches{outputToFile}"); - $logger->warn("perhaps you migh specify it using, for example, -o=++ or -o=+myoutput"); + $logger->warn("perhaps you might specify it using, for example, -o=++ or -o=+myoutput"); $switches{outputToFile} = 0; } diff --git a/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm b/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm index f9839e09aa..3d6dd70af6 100644 --- a/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm +++ b/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm @@ -65,7 +65,7 @@ sub construct_grouping_braces_brackets_regexp { $NamedGroupingFollowRegExp = qr/${${$mainSettings{fineTuning}}{NamedGroupingBracesBrackets}}{follow}/; } - # store the regular expresssion for matching and replacing + # store the regular expression for matching and replacing $grouping_braces_regexp = qr/ ( $NamedGroupingFollowRegExp @@ -95,7 +95,7 @@ sub create_unique_id { sub get_replacement_text { my $self = shift; - # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof +# the replacement text for a key = {value} needes to accommodate the leading [ OR { OR % OR , OR any combination thereof $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{beginningbit} . ${$self}{id}; delete ${$self}{beginningbit}; diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm index 71b1027a1b..bbae745d94 100644 --- a/support/latexindent/LatexIndent/TrailingComments.pm +++ b/support/latexindent/LatexIndent/TrailingComments.pm @@ -70,7 +70,7 @@ sub remove_trailing_comments { # perform the substitution ${$self}{body} =~ s/ - $notPreceededBy # not preceeded by a \ + $notPreceededBy # not preceded by a \ % # % ( \h*? # followed by possible horizontal space @@ -137,7 +137,7 @@ sub put_trailing_comments_back_in { my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/; if (${$self}{body} =~ m/%$trailingcommentID ( - (?! # not immediately preceeded by + (?! # not immediately preceded by $notPreceededBy # \ % # % ).*? diff --git a/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm b/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm index b1d619fad6..bf7008a6b4 100644 --- a/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm +++ b/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm @@ -43,7 +43,7 @@ sub construct_unnamed_grouping_braces_brackets_regexp { my $argumentsBefore = qr/${${$mainSettings{fineTuning}}{arguments}}{before}/; my $UnNamedGroupingFollowRegExp = qr/${${$mainSettings{fineTuning}}{UnNamedGroupingBracesBrackets}}{follow}/; - # store the regular expresssion for matching and replacing + # store the regular expression for matching and replacing $un_named_grouping_braces_RegExp = qr/ # NOT (?! @@ -81,7 +81,7 @@ sub create_unique_id { sub get_replacement_text { my $self = shift; - # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof +# the replacement text for a key = {value} needes to accommodate the leading [ OR { OR % OR , OR any combination thereof $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; # the un-named object is a little special, as it doesn't have a name; as such, if there are blank lines before diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm index 090879ef0d..ba83dc8f66 100644 --- a/support/latexindent/LatexIndent/Version.pm +++ b/support/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.20'; -our $versionDate = '2023-01-01'; +our $versionNumber = '3.20.1'; +our $versionDate = '2023-01-07'; 1 diff --git a/support/latexindent/LatexIndent/Wrap.pm b/support/latexindent/LatexIndent/Wrap.pm index 8af51ed176..b7327f824a 100644 --- a/support/latexindent/LatexIndent/Wrap.pm +++ b/support/latexindent/LatexIndent/Wrap.pm @@ -356,7 +356,7 @@ sub text_wrap { @textWrapBeforeEndWith = (); } - # if we have an occurence of blocksEndBefore, then grab the stuff before it + # if we have an occurrence of blocksEndBefore, then grab the stuff before it if ( scalar @textWrapBeforeEndWith > 1 ) { $textWrapBlockStorageValue = $textWrapBeforeEndWith[0]; } |