diff options
author | Karl Berry <karl@freefriends.org> | 2023-04-07 20:53:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-04-07 20:53:36 +0000 |
commit | 07ecfd020365d0aa57d05f16cde592e73066fc07 (patch) | |
tree | e8f3580406911d1209164497c90f2f6f49d67dd4 /Master/texmf-dist | |
parent | ed6247daaa6ff33f1d7202c5e8fc465ae1006371 (diff) |
latexindent (7apr23)
git-svn-id: svn://tug.org/texlive/trunk@66794 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
12 files changed, 42 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README index 1a2f1058d3e..4a3d96433c6 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.20.4, 2023-03-15 + latexindent.pl, version 3.20.5, 2023-04-07 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/Master/texmf-dist/doc/support/latexindent/contributors.bib b/Master/texmf-dist/doc/support/latexindent/contributors.bib index 5dc370f1873..3e6147f1574 100644 --- a/Master/texmf-dist/doc/support/latexindent/contributors.bib +++ b/Master/texmf-dist/doc/support/latexindent/contributors.bib @@ -192,3 +192,11 @@ author = "Henrik Sloot", urldate = {2023-02-15}, keywords = {contributor},} + +@online{valtterikantanen, + title = "fix: decode the name of the backup file", + url = "https://github.com/cmhughes/latexindent.pl/pull/439", + date = {2023-04-07}, + author = "valtterikantanen", + urldate = {2023-04-07}, + keywords = {contributor},} 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 3c21407f7aa..f2089565dc1 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.20.4 2023-03-15", + "description": "latexindent.pl YAML schema helper, V3.20.5 2023-04-07", "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 7bf086b16db..e6d1ead45dc 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/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm index 82d1a816539..9f54207a572 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -23,6 +23,7 @@ use LatexIndent::LogFile qw/$logger/; use File::Basename; # to get the filename and directory path use File::Copy; # to copy the original file to backup (if overwrite option set) use Exporter qw/import/; +use Encode qw/decode/; our @EXPORT_OK = qw/create_back_up_file check_if_different/; # copy main file to a back up in the case of the overwrite switch being active @@ -35,7 +36,7 @@ sub create_back_up_file { # if we want to over write the current file create a backup first $logger->info("*Backup procedure (-w flag active):"); - my $fileName = ${$self}{fileName}; + my $fileName = decode( "utf-8", ${$self}{fileName} ); # grab the file extension preferences my %fileExtensionPreference = %{ $mainSettings{fileExtensionPreference} }; @@ -48,7 +49,7 @@ sub create_back_up_file { my $backupFile = basename( ${$self}{fileName}, @fileExtensions ); # add the user's backup directory to the backup path - $backupFile = "${$self}{cruftDirectory}/$backupFile"; + $backupFile = decode( "utf-8", "${$self}{cruftDirectory}/$backupFile" ); # local variables, determined from the YAML settings my $onlyOneBackUp = $mainSettings{onlyOneBackUp}; @@ -103,9 +104,9 @@ sub create_back_up_file { for ( my $i = 1; $i <= $maxNumberOfBackUps; $i++ ) { # remove number from backUpFile - my $oldBackupFile = $backupFile; + my $oldBackupFile = decode( "utf-8", $backupFile ); $oldBackupFile =~ s/$backupExtension.*/$backupExtension/; - my $newBackupFile = $oldBackupFile; + my $newBackupFile = decode( "utf-8", $oldBackupFile ); # add numbers back on $oldBackupFile .= $i; diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm index d365388679c..4a99721a344 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm @@ -20,6 +20,7 @@ use warnings; use Data::Dumper; use File::Basename; # to get the filename and directory path use open ':std', ':encoding(UTF-8)'; +use Encode qw/decode/; # gain access to subroutines in the following modules use LatexIndent::Switches @@ -97,7 +98,7 @@ sub latexindent { # one-time operations $self->store_switches; - ${$self}{fileName} = $fileNames[0]; + ${$self}{fileName} = decode( "utf-8", $fileNames[0] ); $self->process_switches( \@fileNames ); $self->yaml_read_settings; @@ -228,13 +229,26 @@ sub output_indented_text { # if -overwrite is active then output to original fileName if ( ${$self}{overwrite} ) { + + # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + ${$self}{fileName} = decode( "utf-8", ${$self}{fileName} ); + $logger->info("Overwriting file ${$self}{fileName}"); open( OUTPUTFILE, ">", ${$self}{fileName} ); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); } elsif ( $switches{outputToFile} ) { + + # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + # + # note, related: + # + # git config --add core.quotePath false + ${$self}{outputToFile} = decode( "utf-8", ${$self}{outputToFile} ); + $logger->info("Outputting to file ${$self}{outputToFile}"); + open( OUTPUTFILE, ">", ${$self}{outputToFile} ); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index 85764353e8a..440e2ef20b7 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -341,6 +341,9 @@ sub yaml_read_settings { } } + # diacritics in YAML names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + $_ = decode( "utf-8", $_ ); + # check for existence and non-emptiness if ( ( -e $_ ) and !( -z $_ ) ) { $logger->info("Adding $_ to YAML read paths"); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm index 0e7201a8009..8fe50458524 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm @@ -146,7 +146,7 @@ sub remove_line_breaks_begin { # there is no white space my $self = shift; my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine} || "BodyStartsOnOwnLine"; - $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)"); + $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{begin} =~ s/\R*$//sx; ${$self}{begin} .= " " unless ( ${$self}{begin} =~ m/\h$/s or ${$self}{body} =~ m/^\h/s or ${$self}{body} =~ m/^\R/s ); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm index 809aa71d2d5..93b6ad0930a 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm @@ -22,6 +22,7 @@ use File::Basename; # to get the filename and directory path use Exporter qw/import/; use LatexIndent::Switches qw/%switches/; use LatexIndent::Version qw/$versionNumber $versionDate/; +use Encode qw/decode/; our @EXPORT_OK = qw/process_switches $logger/; our $logger; @@ -128,6 +129,9 @@ ENDQUOTE # cruft directory ${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} ); + # diacritics in cruft directory (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + ${$self}{cruftDirectory} = decode( "utf-8", ${$self}{cruftDirectory} ); + # if cruft directory does not exist if ( !( -d ${$self}{cruftDirectory} ) ) { $logger->fatal("*Could not find directory ${$self}{cruftDirectory}"); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index e05f59d6f98..457e9c83bf9 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.20.4'; -our $versionDate = '2023-03-15'; +our $versionNumber = '3.20.5'; +our $versionDate = '2023-04-07'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 2dc3f22667e..51a8b222298 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.20.4, 2023-03-15 +# latexindent.pl, version 3.20.5, 2023-04-07 # # defaultSettings.yaml, the default settings for latexindent.pl # diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 4553e6dd7bb..90e9408b0aa 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.20.4, 2023-03-15 +# latexindent.pl, version 3.20.5, 2023-04-07 # # 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 |