From 59ab26e4b8b11acdd61b232207d7a9ae578c63e4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 21 Jan 2022 22:50:29 +0000 Subject: latexindent (21jan22) git-svn-id: svn://tug.org/texlive/trunk@61686 c570f23f-e606-0410-a88d-b1316a301751 --- .../latexindent/LatexIndent/GetYamlSettings.pm | 7 +- .../scripts/latexindent/LatexIndent/Version.pm | 4 +- .../scripts/latexindent/defaultSettings.yaml | 146 ++++++++++----------- .../texmf-dist/scripts/latexindent/latexindent.pl | 2 +- 4 files changed, 81 insertions(+), 78 deletions(-) (limited to 'Master/texmf-dist/scripts/latexindent') diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index bb88a5a8b16..50d33a4f2ff 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -61,8 +61,9 @@ sub yaml_read_settings{ # grab the logger object $logger->info("*YAML settings read: defaultSettings.yaml"); $logger->info("Reading defaultSettings.yaml from $FindBin::RealBin/defaultSettings.yaml"); - - # if latexindent.exe is invoked from TeXLive, then defaultSettings.yaml won't be in + my $myLibDir = dirname(__FILE__); + + # if latexindent.exe is invoked from TeXLive, then defaultSettings.yaml won't be in # the same directory as it; we need to navigate to it if(!$defaultSettings) { $logger->info("Reading defaultSettings.yaml (2nd attempt) from $FindBin::RealBin/../../texmf-dist/scripts/latexindent/defaultSettings.yaml"); @@ -71,6 +72,8 @@ sub yaml_read_settings{ $defaultSettings = YAML::Tiny->read( "$FindBin::RealBin/../../texmf-dist/scripts/latexindent/defaultSettings.yaml"); } elsif ( -e "$FindBin::RealBin/LatexIndent/defaultSettings.yaml" ) { $defaultSettings = YAML::Tiny->read( "$FindBin::RealBin/LatexIndent/defaultSettings.yaml"); + } elsif ( -e "$myLibDir/defaultSettings.yaml" ) { ++ $defaultSettings = YAML::Tiny->read( "$myLibDir/defaultSettings.yaml"); } else { $logger->fatal("*Could not open defaultSettings.yaml"); $self->output_logfile(); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index 8b3aadca2dd..313d0ffb02c 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.14'; -our $versionDate = '2022-01-08'; +our $versionNumber = '3.15'; +our $versionDate = '2022-01-21'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 32bab97e976..f375b470230 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.14, 2022-01-08 +# defaultSettings.yaml for latexindent.pl, version 3.15, 2022-01-21 # a script that aims to # beautify .tex, .sty, .cls files # @@ -9,21 +9,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # See http://www.gnu.org/licenses/. -# +# # Chris Hughes, 2017 -# +# # For all communication, please visit: https://github.com/cmhughes/latexindent.pl # #--------------------------------------------------------------------------------------- -# You should feel encouraged to change anything you like in these settings, but -# it would probably be better to have your own user settings +# You should feel encouraged to change anything you like in these settings, but +# it would probably be better to have your own user settings # files somewhere else - remember that this file may be overwritten # when you update your tex distribution. Please see the manual linked from: # @@ -35,7 +35,7 @@ # #--------------------------------------------------------------------------------------- -# latexindent can be called to act on a file without using the file's extension, +# latexindent can be called to act on a file without using the file's extension, # e.g, simply # latexindent myfile # in which case the choice of file extension is chosen @@ -50,13 +50,13 @@ fileExtensionPreference: # default file extension of backup file (if -w switch is active) # for example, if your .tex file is called # myfile.tex -# and you specify the backupExtension as BACKUP.bak then your +# and you specify the backupExtension as BACKUP.bak then your # backup file will be # myfileBACKUP.bak backupExtension: .bak -# only one backup per file: -# - if onlyOneBackUp is 0 then, as a safety measure, +# only one backup per file: +# - if onlyOneBackUp is 0 then, as a safety measure, # the number on the extension increments by 1 each time: # # myfile.bak0, myfile.bak1, myfile.bak2 @@ -64,16 +64,16 @@ backupExtension: .bak # be overwritten each time (not recommended until you trust the script) onlyOneBackUp: 0 -# some users may want a finite number of backup files, +# some users may want a finite number of backup files, # say at most 3; in which case, they can change this maxNumberOfBackUps. # -# If maxNumberOfBackUps is set to 0 (or less) then infinitely +# If maxNumberOfBackUps is set to 0 (or less) then infinitely # many backups are possible, unless onlyOneBackUp is switched on maxNumberOfBackUps: 0 -# some users may wish to cycle through back up files. +# some users may wish to cycle through back up files. # -# for example, with maxNumberOfBackUps: 4, they may +# for example, with maxNumberOfBackUps: 4, they may # wish to delete the oldest back up file, and keep only the most recent. # # copy myfile.bak1 to myfile.bak0 @@ -90,7 +90,7 @@ logFilePreferences: showAmalgamatedSettings: 0 showDecorationStartCodeBlockTrace: 0 showDecorationFinishCodeBlockTrace: 0 - endLogFileWith: '--------------' + endLogFileWith: '--------------' showGitHubInfoFooter: 1 Dumper: Terse: 1 @@ -101,7 +101,7 @@ logFilePreferences: Sortkeys: 1 Pair: " => " -# verbatim environments specified +# verbatim environments specified # in this field will not be changed at all! verbatimEnvironments: verbatim: 1 @@ -113,7 +113,7 @@ verbatimCommands: verb: 1 lstinline: 1 -# no indent blocks (not necessarily verbatim +# no indent blocks (not necessarily verbatim # environments) which are marked as %\begin{noindent} # or anything else that you detail in the following noIndentBlock: @@ -146,14 +146,14 @@ preambleCommandsBeforeEnvironments: 0 # default value of indentation defaultIndent: "\t" -# remove trailing whitespace from all lines +# remove trailing whitespace from all lines removeTrailingWhitespace: beforeProcessing: 0 afterProcessing: 1 # name of code blocks that should have their body aligned at ampersand delimiters lookForAlignDelims: - tabular: + tabular: delims: 1 alignDoubleBackSlash: 1 spacesBeforeDoubleBackSlash: 1 @@ -217,7 +217,7 @@ lookForAlignDelims: VNiceArrayRC: 1 NiceArrayRCwithDelims: 1 -# if you want the script to look for \item commands +# if you want the script to look for \item commands # and format it, as follows (for example), # \begin{itemize} # \item content here @@ -234,7 +234,7 @@ indentAfterItems: # if you want to use other names for your items (for example, \part) # then populate them here; note that you can trick latexindent.pl -# into indenting all kinds of commands (within environments specified in +# into indenting all kinds of commands (within environments specified in # indentAfterItems) using this technique. itemNames: item: 1 @@ -259,17 +259,17 @@ specialBeginEnd: # if you want to add indentation after # a heading, such as \part, \chapter, etc -# then populate it in here - you can add -# an indent rule to indentRules if you would +# then populate it in here - you can add +# an indent rule to indentRules if you would # like something other than defaultIndent # -# you can also change the level if you like, +# you can also change the level if you like, # or add your own title command indentAfterHeadings: part: indentAfterThisHeading: 0 level: 1 - chapter: + chapter: indentAfterThisHeading: 0 level: 2 section: @@ -294,9 +294,9 @@ indentAfterHeadings: # maximum indentation, off by default maximumIndentation: -1 -# if you don't want to have additional indentation +# if you don't want to have additional indentation # in a code block, then add it to noAdditionalIndent; note that -# code blocks in this field will inherit +# code blocks in this field will inherit # the *current* level of indentation they just won't # get any *additional* indentation noAdditionalIndent: @@ -312,7 +312,7 @@ noAdditionalIndent: frame: 0 # if you have indent rules for particular code blocks -# then you can populate them in indentRules; for example, you might just want +# then you can populate them in indentRules; for example, you might just want # to use a space " " or maybe a double tab "\t\t" indentRules: myenvironment: "\t\t" @@ -337,7 +337,7 @@ noAdditionalIndentGlobal: afterHeading: 0 filecontents: 0 -# set indentRules globally for codeblocks; these need +# set indentRules globally for codeblocks; these need # to be horizontal spaces, if they are to be used indentRulesGlobal: environments: 0 @@ -357,7 +357,7 @@ indentRulesGlobal: commandCodeBlocks: roundParenthesesAllowed: 1 stringsAllowedBetweenArguments: - - + - amalgamate: 1 - 'node' - 'at' @@ -367,128 +367,128 @@ commandCodeBlocks: - '\-\-' - '\#\#\d' commandNameSpecial: - - + - amalgamate: 1 - '@ifnextchar\[' # change dos line breaks into unix dos2unixlinebreaks: 0 -# modifyLineBreaks will only be searched if the -m +# modifyLineBreaks will only be searched if the -m # switch is active # # poly-switch examples: # -# BeginStartsOnOwnLine: +# BeginStartsOnOwnLine: # modify line breaks before a begin statement # -# when set to -1, e.g -# some text some text +# when set to -1, e.g +# some text some text # \begin{myenvironment} # will be changed to # some text some text \begin{myenvironment} # when set to 0, the switch is ignored -# when set to 1, e.g +# when set to 1, e.g # some text some text \begin{myenvironment} # will be changed to -# some text some text +# some text some text # \begin{myenvironment} -# when set to 2, e.g +# when set to 2, e.g # some text some text \begin{myenvironment} # will be changed to # some text some text% # \begin{myenvironment} -# when set to 3, e.g +# when set to 3, e.g # some text some text \begin{myenvironment} # will be changed to # some text some text # # \begin{myenvironment} # -# BodyStartsOnOwnLine: +# BodyStartsOnOwnLine: # modify line breaks before the beginning of the body # -# when set to -1, e.g +# when set to -1, e.g # \begin{myenv} # body text body text # will be changed to # \begin{myenv}body text body text # when set to 0, the switch is ignored -# when set to 1, e.g +# when set to 1, e.g # \begin{myenv}body text body text # will be changed to # \begin{myenv} # body text body text -# when set to 2, e.g +# when set to 2, e.g # \begin{myenv}body text body text # will be changed to # \begin{myenv}% # body text body text -# when set to 3, e.g +# when set to 3, e.g # \begin{myenv}body text body text # will be changed to # \begin{myenv} # # body text body text # -# EndStartsOnOwnLine: +# EndStartsOnOwnLine: # modify line breaks before the end statement # -# when set to -1, e.g -# some text some text +# when set to -1, e.g +# some text some text # \end{myenvironment} # will be changed to # some text some text \end{myenvironment} # when set to 0, the switch is ignored -# when set to 1, e.g +# when set to 1, e.g # some text some text \end{myenvironment} # will be changed to -# some text some text +# some text some text # \end{myenvironment} -# when set to 2, e.g +# when set to 2, e.g # some text some text \end{myenvironment} # will be changed to # some text some text% # \end{myenvironment} -# when set to 3, e.g +# when set to 3, e.g # some text some text \end{myenvironment} # will be changed to # some text some text # # \end{myenvironment} # -# EndFinishesWithLineBreak: +# EndFinishesWithLineBreak: # modify line breaks after the end statement -# -# when set to -1, e.g +# +# when set to -1, e.g # \end{myenvironment} -# some text some text +# some text some text # will be changed to -# \end{myenvironment}some text some text +# \end{myenvironment}some text some text # when set to 0, the switch is ignored -# when set to 1, e.g -# \end{myenvironment}some text some text +# when set to 1, e.g +# \end{myenvironment}some text some text # will be changed to # \end{myenvironment} -# some text some text -# when set to 2, e.g -# \end{myenvironment}some text some text +# some text some text +# when set to 2, e.g +# \end{myenvironment}some text some text # will be changed to # \end{myenvironment}% -# some text some text -# when set to 3, e.g -# \end{myenvironment}some text some text +# some text some text +# when set to 3, e.g +# \end{myenvironment}some text some text # will be changed to # \end{myenvironment} # -# some text some text +# some text some text # # you can specify settings on a per-name basis modifyLineBreaks: preserveBlankLines: 1 condenseMultipleBlankLinesInto: 1 oneSentencePerLine: - manipulateSentences: 0 + manipulateSentences: 0 removeSentenceLineBreaks: 1 textWrapSentences: 0 sentenceIndent: "" @@ -519,7 +519,7 @@ modifyLineBreaks: beforeFindingChildCodeBlocks: 0 all: 0 alignAtAmpersandTakesPriority: 1 - environments: + environments: quotation: 0 ifElseFi: 0 optionalArguments: 0 @@ -534,7 +534,7 @@ modifyLineBreaks: all: 0 beforeTextWrap: 0 alignAtAmpersandTakesPriority: 1 - environments: + environments: quotation: 0 ifElseFi: 0 optionalArguments: 0 @@ -617,7 +617,7 @@ modifyLineBreaks: # replacements, only active when either -r or -rr switches are active replacements: - - + - amalgamate: 1 - this: 'latexindent.pl' @@ -625,11 +625,11 @@ replacements: lookForThis: 0 when: before -# fineTuning allows you to tweak the internal pattern matching that +# fineTuning allows you to tweak the internal pattern matching that # is central to latexindent.pl fineTuning: environments: - name: '[a-zA-Z@\*0-9_\\]+' + name: '[a-zA-Z@\*0-9_\\]+' ifElseFi: name: '(?!@?if[a-zA-Z@]*?\{)@?if[a-zA-Z@]*?' commands: @@ -642,7 +642,7 @@ fineTuning: namedGroupingBracesBrackets: name: '[0-9\.a-zA-Z@\*><]+?' follow: '\h|\R|\{|\[|\$|\)|\(' - UnNamedGroupingBracesBrackets: + UnNamedGroupingBracesBrackets: follow: '\{|\[|,|&|\)|\(|\$' arguments: before: '(?:#\d\h*;?,?\/?)+|\<.*?\>' diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index eedd30b286a..d52f46f10fd 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.14, 2022-01-08 +# latexindent.pl, version 3.15, 2022-01-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