From 35fe6a75176f311bae7b0f9066e535918a6f50ce Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Wed, 12 Jun 2024 08:45:56 +0000 Subject: chktex 1.7.9 git-svn-id: svn://tug.org/texlive/trunk@71501 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/chktex/chktex-src/FindErrs.c | 24 ++++++++++++---- Build/source/texk/chktex/chktex-src/NEWS | 8 ++++++ Build/source/texk/chktex/chktex-src/Test.nore.out | 6 ++++ Build/source/texk/chktex/chktex-src/Test.pcre.out | 8 +++++- .../texk/chktex/chktex-src/Test.posix-ere.out | 8 +++++- Build/source/texk/chktex/chktex-src/Test.tex | 11 ++++++++ Build/source/texk/chktex/chktex-src/chktexrc.in | 32 +++++++++++----------- Build/source/texk/chktex/chktex-src/configure.ac | 2 +- Build/source/texk/chktex/chktex-src/lacheck | 27 ------------------ Build/source/texk/chktex/chktex-src/test-all.sh | 19 +++++++++++++ 10 files changed, 94 insertions(+), 51 deletions(-) delete mode 100755 Build/source/texk/chktex/chktex-src/lacheck create mode 100644 Build/source/texk/chktex/chktex-src/test-all.sh (limited to 'Build/source/texk/chktex/chktex-src') diff --git a/Build/source/texk/chktex/chktex-src/FindErrs.c b/Build/source/texk/chktex/chktex-src/FindErrs.c index 00ca49f48e0..3548103a9c5 100644 --- a/Build/source/texk/chktex/chktex-src/FindErrs.c +++ b/Build/source/texk/chktex/chktex-src/FindErrs.c @@ -351,6 +351,7 @@ static char *PreProcess(void) EscapePtr = TmpPtr; /* Save it for later */ while ((TmpPtr = strstr(TmpPtr, FileSuppDelim))) { + uint64_t errbit; TmpPtr += STRLEN(FileSuppDelim); error = atoi(TmpPtr); @@ -358,7 +359,7 @@ static char *PreProcess(void) { 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; @@ -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))) @@ -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 */ @@ -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]); diff --git a/Build/source/texk/chktex/chktex-src/NEWS b/Build/source/texk/chktex/chktex-src/NEWS index 5605c50b2d6..b73fdf828ef 100644 --- a/Build/source/texk/chktex/chktex-src/NEWS +++ b/Build/source/texk/chktex/chktex-src/NEWS @@ -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 + + * 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 * Fix some packaging issues for CTAN diff --git a/Build/source/texk/chktex/chktex-src/Test.nore.out b/Build/source/texk/chktex/chktex-src/Test.nore.out index 07393eabd9b..85fd2922a71 100644 --- a/Build/source/texk/chktex/chktex-src/Test.nore.out +++ b/Build/source/texk/chktex/chktex-src/Test.nore.out @@ -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. @@ -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 $ ... $. diff --git a/Build/source/texk/chktex/chktex-src/Test.pcre.out b/Build/source/texk/chktex/chktex-src/Test.pcre.out index 2f47f60de11..7f3eeb23b73 100644 --- a/Build/source/texk/chktex/chktex-src/Test.pcre.out +++ b/Build/source/texk/chktex/chktex-src/Test.pcre.out @@ -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. @@ -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 $ ... $. @@ -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. diff --git a/Build/source/texk/chktex/chktex-src/Test.posix-ere.out b/Build/source/texk/chktex/chktex-src/Test.posix-ere.out index f22f757d729..c504259f26e 100644 --- a/Build/source/texk/chktex/chktex-src/Test.posix-ere.out +++ b/Build/source/texk/chktex/chktex-src/Test.posix-ere.out @@ -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. @@ -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 $ ... $. @@ -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. diff --git a/Build/source/texk/chktex/chktex-src/Test.tex b/Build/source/texk/chktex/chktex-src/Test.tex index 12854473552..41fa5f7ab73 100644 --- a/Build/source/texk/chktex/chktex-src/Test.tex +++ b/Build/source/texk/chktex/chktex-src/Test.tex @@ -95,6 +95,14 @@ Mr. ``X'' and Mrs. \(Y\) % 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. @@ -213,6 +221,9 @@ foo \above qux % 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}$. diff --git a/Build/source/texk/chktex/chktex-src/chktexrc.in b/Build/source/texk/chktex/chktex-src/chktexrc.in index 491a5792fc8..2b7362cee4e 100644 --- a/Build/source/texk/chktex/chktex-src/chktexrc.in +++ b/Build/source/texk/chktex/chktex-src/chktexrc.in @@ -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 @@ -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 @@ -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. @@ -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. @@ -129,7 +129,7 @@ ### \subsubsection{Settings in the \rsrc\ file} ## Available Settings # -# All avaiable settings follow. +# All available settings follow. # ## QuoteStyle @@ -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. # # @@ -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} @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/Build/source/texk/chktex/chktex-src/configure.ac b/Build/source/texk/chktex/chktex-src/configure.ac index 3cb717df7f4..db2a86eed29 100644 --- a/Build/source/texk/chktex/chktex-src/configure.ac +++ b/Build/source/texk/chktex/chktex-src/configure.ac @@ -27,7 +27,7 @@ dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT([ChkTeX],[1.7.8]) +AC_INIT([ChkTeX],[1.7.9]) AC_SUBST(SCRIPTS) AC_SUBST(BUILT_SCRIPTS) AC_SUBST(CLEAN) diff --git a/Build/source/texk/chktex/chktex-src/lacheck b/Build/source/texk/chktex/chktex-src/lacheck deleted file mode 100755 index da75d360dee..00000000000 --- a/Build/source/texk/chktex/chktex-src/lacheck +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh - -# lacheck replacement 1.0, lacheck <-> ChkTeX interface (UNIX). -# Copyright (C) 1996 Jens T. Berger Thielemann -# -# 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 -# the Free Software Foundation; either version 2 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Contact the author at: -# Jens Berger -# Spektrumvn. 4 -# N-0666 Oslo -# Norway -# E-mail: - -chktex -v3 $* diff --git a/Build/source/texk/chktex/chktex-src/test-all.sh b/Build/source/texk/chktex/chktex-src/test-all.sh new file mode 100644 index 00000000000..40c029c70c1 --- /dev/null +++ b/Build/source/texk/chktex/chktex-src/test-all.sh @@ -0,0 +1,19 @@ +#!/usr/local/bin/bash + +set -e + +# All 3 RE options +./configure --disable-pcre --disable-posixre +make check + +./configure --disable-pcre --enable-posixre +make check + +./configure --enable-pcre +make check + +# Out of directory build +mkdir -p build +cd build +../configure --enable-pcre +make check -- cgit v1.2.3