Skip to content

Commit

Permalink
chktex 1.7.9
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@71501 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
Akira Kakuto committed Jun 12, 2024
1 parent 86887f1 commit c561d0a
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 80 deletions.
2 changes: 1 addition & 1 deletion texk/README
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ afm2pl - maintained here
bibtex-x - maintained here, contains
bibtex8, bibtexu

chktex 1.7.8 - checked 15dec22
chktex 1.7.9 - checked 12jun24
https://mirror.ctan.org/support/chktex/
https://download.savannah.gnu.org/releases/chktex/

Expand Down
5 changes: 5 additions & 0 deletions texk/chktex/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-06-12 Alira Kakuto <kakuto@jcom.zaq.ne.jp>

* Import ChkTeX 1.7.9.
* version.ac: adapted.

2022-12-15 Hironobu Yamashita <h.y.acetaminophen@gmail.com>

* Import ChkTeX 1.7.8.
Expand Down
Binary file modified texk/chktex/ChkTeX.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions texk/chktex/TLpatches/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2024-06-12 Akira Kakuto <kakuto@jcom.zaq.ne.jp>

* Import chktex-1.7.9.
* patch-03-late-decl: Revive once more to support old
compilers.

2022-12-15 Hironobu Yamashita <h.y.acetaminophen@gmail.com>

* Import chktex-1.7.8.
Expand Down
5 changes: 2 additions & 3 deletions texk/chktex/TLpatches/TL-Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Changes applied to the chktex-1.7.8 tree as obtained from:
http://mirror.ctan.org/support/chktex/
http://download.savannah.gnu.org/releases/chktex/chktex-1.7.8.tar.gz
Changes applied to the chktex-1.7.9 tree as obtained from:
http://mirror.ctan.org/support/chktex.zip

Remove:
aclocal.m4
Expand Down
44 changes: 44 additions & 0 deletions texk/chktex/TLpatches/patch-03-late-decl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff -ur chktex/FindErrs.c chktex-src/FindErrs.c
--- chktex/FindErrs.c Sat Apr 27 02:28:46 2024
+++ chktex-src/FindErrs.c Wed Jun 12 17:25:32 2024
@@ -351,6 +351,7 @@

EscapePtr = TmpPtr; /* Save it for later */
while ((TmpPtr = strstr(TmpPtr, FileSuppDelim))) {
+ uint64_t errbit;
TmpPtr += STRLEN(FileSuppDelim);
error = atoi(TmpPtr);

@@ -358,7 +359,7 @@
{
PrintPrgErr(pmSuppTooHigh, error, MaxSuppressionBits);
}
- uint64_t errbit = ((uint64_t)1 << abs(error));
+ errbit = ((uint64_t)1 << abs(error));
if (error > 0)
{
*(uint64_t *)StkTop(&FileSuppStack) |= errbit;
@@ -1133,19 +1134,21 @@
* this on the first dash */
if (*TmpPtr != '-')
{
+ struct WordList *el;
/* PrePtr now points to the beginning of the hyphenated phrase */
PrePtr = ++TmpPtr;

- struct WordList *el = &DashExcpt;
+ el = &DashExcpt;

FORWL(i, *el)
{
+ int FoundHyphenDiff;
char *e = el->Stack.Data[i];
TmpPtr = PrePtr;

/* Walk through the strings until we find a
* mismatch. */
- int FoundHyphenDiff = FALSE;
+ FoundHyphenDiff = FALSE;
while (*e && *TmpPtr && *e == *TmpPtr)
{
/* Skip past characters that are the same */
24 changes: 19 additions & 5 deletions texk/chktex/chktex-src/FindErrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,15 @@ static char *PreProcess(void)

EscapePtr = TmpPtr; /* Save it for later */
while ((TmpPtr = strstr(TmpPtr, FileSuppDelim))) {
uint64_t errbit;
TmpPtr += STRLEN(FileSuppDelim);
error = atoi(TmpPtr);

if (abs(error) > MaxSuppressionBits)
{
PrintPrgErr(pmSuppTooHigh, error, MaxSuppressionBits);
}
uint64_t errbit = ((uint64_t)1 << abs(error));
errbit = ((uint64_t)1 << abs(error));
if (error > 0)
{
*(uint64_t *)StkTop(&FileSuppStack) |= errbit;
Expand Down Expand Up @@ -662,7 +663,7 @@ static void PerformBigCmd(char *CmdPtr)
PSERR(CmdPtr - Buf, CmdLen, emNoArgFound);
}

if (HasWord(CmdBuffer, &NotPreSpaced) && isspace((unsigned char)CmdPtr[-1]))
if (HasWord(CmdBuffer, &NotPreSpaced) && SeenSpace)
PSERRA(CmdPtr - Buf - 1, 1, emRemPSSpace, CmdBuffer);

if ((TmpPtr = HasWord(CmdBuffer, &NoCharNext)))
Expand Down Expand Up @@ -1133,19 +1134,21 @@ static void CheckDash(void)
* this on the first dash */
if (*TmpPtr != '-')
{
struct WordList *el;
/* PrePtr now points to the beginning of the hyphenated phrase */
PrePtr = ++TmpPtr;

struct WordList *el = &DashExcpt;
el = &DashExcpt;

FORWL(i, *el)
{
int FoundHyphenDiff;
char *e = el->Stack.Data[i];
TmpPtr = PrePtr;

/* Walk through the strings until we find a
* mismatch. */
int FoundHyphenDiff = FALSE;
FoundHyphenDiff = FALSE;
while (*e && *TmpPtr && *e == *TmpPtr)
{
/* Skip past characters that are the same */
Expand Down Expand Up @@ -1586,11 +1589,22 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
strchr(LTX_BosPunc, TmpC)));
if (islower((unsigned char)*TmpPtr))
{
/* If it's a silent macro, count it as space. */
int IsSilent = FALSE;
if (*(TmpPtr - 1) == '\\')
{
GetLTXToken(TmpPtr - 1, CmdBuffer);
IsSilent = CheckSilentRegex();
}

/* Ignore spacing problems after commands if desired */
TmpPtr = PrePtr;
SKIP_BACK(TmpPtr, TmpC, istex(TmpC));
if (*TmpPtr != '\\' || (CmdSpace & csInterWord))
if (!IsSilent &&
(*TmpPtr != '\\' || (CmdSpace & csInterWord)))
{
PSERR(BufPtr - Buf, 1, emInterWord);
}
}
else
CheckAbbrevs(&BufPtr[-1]);
Expand Down
8 changes: 8 additions & 0 deletions texk/chktex/chktex-src/NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Development of ChkTeX is now in a maintainance mode. All versions
1.6.x are essentially bug fixes. Version 1.7 added some new features.

1.7.9 (2024-04-26), released by Ivan Andrus <darthandrus@gmail.com>

* Spell check chktexrc.in
* Check SeenSpace instead of the previous character #65570
* Treat silent macros as space for the purposes of interword spacing #65500
* Mark a regex as being PCRE only #65033
* Fix typo in rule message #64810

1.7.8 (2022-10-17), released by Ivan Andrus <darthandrus@gmail.com>

* Fix some packaging issues for CTAN
Expand Down
6 changes: 6 additions & 0 deletions texk/chktex/chktex-src/Test.nore.out
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ Message 22 in Test.tex: Comment displayed.
% ignore commands by default
^
Message 22 in Test.tex: Comment displayed.
% Bug 65500
^
Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Expand Down Expand Up @@ -557,6 +560,9 @@ Message 42 in Test.tex: You should remove spaces in front of `\footnote'
This is a footnote \footnote{foo}.
^
Message 22 in Test.tex: Comment displayed.
This is a footnote%
^
Message 22 in Test.tex: Comment displayed.
% Warning 43
^
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Expand Down
8 changes: 7 additions & 1 deletion texk/chktex/chktex-src/Test.pcre.out
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ Message 22 in Test.tex: Comment displayed.
% ignore commands by default
^
Message 22 in Test.tex: Comment displayed.
% Bug 65500
^
Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Expand Down Expand Up @@ -548,6 +551,9 @@ Message 42 in Test.tex: You should remove spaces in front of `\footnote'
This is a footnote \footnote{foo}.
^
Message 22 in Test.tex: Comment displayed.
This is a footnote%
^
Message 22 in Test.tex: Comment displayed.
% Warning 43
^
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Expand Down Expand Up @@ -682,7 +688,7 @@ Message 22 in Test.tex: Comment displayed.
Message 44 in Test.tex: User Regex: -2:Vertical rules in tables are ugly.
\begin{tabular*}{1.0\linewidth}[h]{|c|cc|}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Message 44 in Test.tex: User Regex: -2:Use \toprule, midrule, or \bottomrule from booktabs.
Message 44 in Test.tex: User Regex: -2:Use \toprule, \midrule, or \bottomrule from booktabs.
\hline
^^^^^^
Message 22 in Test.tex: Comment displayed.
Expand Down
8 changes: 7 additions & 1 deletion texk/chktex/chktex-src/Test.posix-ere.out
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ Message 22 in Test.tex: Comment displayed.
% ignore commands by default
^
Message 22 in Test.tex: Comment displayed.
% Bug 65500
^
Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Expand Down Expand Up @@ -545,6 +548,9 @@ Message 42 in Test.tex: You should remove spaces in front of `\footnote'
This is a footnote \footnote{foo}.
^
Message 22 in Test.tex: Comment displayed.
This is a footnote%
^
Message 22 in Test.tex: Comment displayed.
% Warning 43
^
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Expand Down Expand Up @@ -664,7 +670,7 @@ Message 22 in Test.tex: Comment displayed.
Message 44 in Test.tex: User Regex: -2:Vertical rules in tables are ugly.
\begin{tabular*}{1.0\linewidth}[h]{|c|cc|}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Message 44 in Test.tex: User Regex: -2:Use \toprule, midrule, or \bottomrule from booktabs.
Message 44 in Test.tex: User Regex: -2:Use \toprule, \midrule, or \bottomrule from booktabs.
\hline
^^^^^^
Message 22 in Test.tex: Comment displayed.
Expand Down
11 changes: 11 additions & 0 deletions texk/chktex/chktex-src/Test.tex
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
% ignore commands by default
\Mr. ``X'' and \Mrs. \(Y\)


% Bug 65500
\begin{tabular}{lp}
1 & foo. \\
2 & bar. \newline kjl
\end{tabular}


% Warning 13

Look at THIS! It's an error.
Expand Down Expand Up @@ -213,6 +221,9 @@
% Warning 42
This is a footnote \footnote{foo}.
This is a footnote\footnote{foo}.
This is a footnote%
\footnote{foo}.


% Warning 43
Here is a mistake $\left{x\right}$.
Expand Down
32 changes: 16 additions & 16 deletions texk/chktex/chktex-src/chktexrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
##### TODO: Use something besides errexam?
##### TODO: Color/frame for default value
###############################################################################
#### This fiie is input to a simple "tangle" process. The extions of .in is
#### This file is input to a simple "tangle" process. The extensions of .in is
#### a little misleading in that it's not managed by autotools or m4. Sorry.
####
#### Two different files are created from this file by calling MakeChkTeXRC.pl
#### 1. chktexrc, a self-documenting chktecrc example
#### 1. chktexrc, a self-documenting chktexrc example
#### a. Lines with 3 (or more) leading #'s are discarded
#### b. Other lines are kept as is
#### 2. ChkTeXRC.tex, LaTeX documentation for chktecrc.
#### 2. ChkTeXRC.tex, LaTeX documentation for chktexrc.
#### a. Lines with 4 (or more) leading #'s are discarded
#### b. Lines with 0 or 2 (exactly) leading #'s are discarded
#### c. Lines with 1 or 3 (exactly) leading #'s are turned in (LaTeX-only) lines
Expand Down Expand Up @@ -44,11 +44,11 @@
### \subsubsection{The \rsrc\ file format}
## chktexrc file format
#
# The chktecrc file is essentially a bunch of variable assignments.
# The chktexrc file is essentially a bunch of variable assignments.
# There are two types of variables, those that take single items and
# those that take lists.
#
# In turn, there are two types of lists, case-sensitive and case-insentive.
# In turn, there are two types of lists, case-sensitive and case-insensitive.
# Case-sensitive lists are delimited by @verb@{@endverb@ and @verb@}@endverb@
# while case-insensitive are delimited by @verb@[@endverb@ and @verb@]@endverb@.
# Only some variables support case insensitive lists, since in many
Expand All @@ -58,7 +58,7 @@
#
# Variables can be set with or without an equals sign. If included, the
# @verb@=@endverb@ causes the variable to be overwritten. This is the only thing
# that makes sense for varibles taking a single item and so we always
# that makes sense for variables taking a single item and so we always
# include it in that case. For list variables, omitting the equals
# sign will cause the items in the list to be appended instead of
# overwriting the entire list.
Expand Down Expand Up @@ -89,7 +89,7 @@
# You can use double quotes @verb@"@endverb@ to surround an item with spaces, or you can
# escape spaces as described later.
#
# Detection of tokens like @verb@}@endverb@ are somewhat context sensitve---they
# Detection of tokens like @verb@}@endverb@ are somewhat context sensitive---they
# have to be preceded by a space (or newline). This allows them to be
# part of an item without escaping. Since some variables require such
# characters, this generally makes life easier.
Expand Down Expand Up @@ -129,7 +129,7 @@
### \subsubsection{Settings in the \rsrc\ file}
## Available Settings
#
# All avaiable settings follow.
# All available settings follow.
#

## QuoteStyle
Expand Down Expand Up @@ -171,12 +171,12 @@ TabSize = 8
### \medskip
### \begin{chktexrcsimplevar}{CmdSpaceStyle}
#
# How to treat a command is followed by punction. In all cases the
# How to treat a command is followed by punctuation. In all cases the
# warnings are also governed by the main warning settings, namely
# warnings 12 and 13 about interword and intersentence spacings.
### These can be found on page~\pageref{warn:interword}.
#
# If set to Ignore, then it won't print any warnings when pucntuation
# If set to Ignore, then it won't print any warnings when punctuation
# follows a command.
#
#
Expand Down Expand Up @@ -308,13 +308,13 @@ UserWarnRegex
# POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$)

# Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf
(?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline
(?!#-2:Use! \toprule,! \midrule,! or! \bottomrule! from! booktabs)\\hline
# This relies on it being on a single line, and not having anything
# else on that line. With PCRE we could match balanced [] and {},
# but I wonder if it's worth the complexity...
(?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\}

(?!#-3:Optional! arguments! []! inside! optional! arguments! []! must! be! enclosed! in! {})\[(?!![^\]\[{}]*{(?!![^\]\[{}]*}))[^\]]*\[
(?!#-3:Optional! arguments! []! inside! optional! arguments! []! must! be! enclosed! in! {})PCRE:\[(?!![^\]\[{}]*{(?!![^\]\[{}]*}))[^\]]*\[

}
### \end{verbatim}
Expand Down Expand Up @@ -567,7 +567,7 @@ DashExcpt
# star variant, two optional arguments, and one required argument.
#
# These commands may be ``evaluated'' before they're wiped, so you will
# typically list filehandling commands and similar here.
# typically list file handling commands and similar here.
#
### \chktexrcdefault\begin{verbatim}
WipeArg
Expand Down Expand Up @@ -759,7 +759,7 @@ Abbrev
### \begin{chktexrclistvar}{IJAccent}
#
# Commands which add accents above characters. This means that @verb@\i@endverb@ or @verb@\j@endverb@
# (@verb@\imath@endverb@ and @verb@\jmath@endverb@ in mathmode) should be used instead of @verb@i@endverb@ and @verb@j@endverb@.
# (@verb@\imath@endverb@ and @verb@\jmath@endverb@ in math mode) should be used instead of @verb@i@endverb@ and @verb@j@endverb@.
#
# Other accent commands such as @verb@\c@endverb@, @verb@\d@endverb@, and @verb@\b@endverb@, put their accent under
# the character, and thus should be used with normal @verb@i@endverb@s and @verb@j@endverb@s.
Expand Down Expand Up @@ -810,7 +810,7 @@ NonItalic
# needs italic correction in the end).
#
# This is currently empty, since @verb@\textit@endverb@, @verb@\textsl@endverb@, and @verb@\emph@endverb@
# automatically add italic corecction.
# automatically add italic correction.
#
### \chktexrcdefault\begin{verbatim}
ItalCmd
Expand Down Expand Up @@ -963,7 +963,7 @@ NoCharNext
#
# The arguments of commands listed in@ref@WipeArg@endref@, as well as
# @verb@\verb+...+@endverb@ commands, are replaced with an innocuous character
# to prevent that data from inadvertantly producing a warning.
# to prevent that data from inadvertently producing a warning.
#
# This should not contain an alphabetic character (in case the user
# writes (@verb@\foo\verb+bar+@endverb@), neither should it contain be one of
Expand Down
Loading

0 comments on commit c561d0a

Please sign in to comment.