From a281920f9c8353be9c15bbbe556e3417a83c56fb Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 15 Sep 2016 23:02:10 +0000 Subject: ChkTeX 1.7.6 git-svn-id: svn://tug.org/texlive/trunk@42080 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/chktex/ChangeLog | 6 + Build/source/texk/chktex/ChkTeX.pdf | Bin 225331 -> 355998 bytes Build/source/texk/chktex/ChkTeX.tex | 23 ++- Build/source/texk/chktex/chktex-PATCHES/ChangeLog | 5 + Build/source/texk/chktex/chktex-PATCHES/TL-Changes | 5 +- .../texk/chktex/chktex-PATCHES/patch-03-late-decl | 13 -- Build/source/texk/chktex/chktex-src/ChkTeX.c | 14 +- Build/source/texk/chktex/chktex-src/ChkTeX.h | 8 +- Build/source/texk/chktex/chktex-src/ChkTeX.tex.in | 19 ++- Build/source/texk/chktex/chktex-src/FindErrs.c | 101 +++++++++---- Build/source/texk/chktex/chktex-src/FindErrs.h | 6 +- Build/source/texk/chktex/chktex-src/Makefile.in | 5 +- Build/source/texk/chktex/chktex-src/NEWS | 19 +++ Build/source/texk/chktex/chktex-src/Test.nore.out | 129 +++++++++++++++++ Build/source/texk/chktex/chktex-src/Test.pcre.out | 129 +++++++++++++++++ .../texk/chktex/chktex-src/Test.posix-ere.out | 129 +++++++++++++++++ Build/source/texk/chktex/chktex-src/Test.tex | 10 ++ Build/source/texk/chktex/chktex-src/Utility.c | 43 ++++-- Build/source/texk/chktex/chktex-src/chktexrc | 4 +- Build/source/texk/chktex/chktex-src/configure.in | 2 +- Build/source/texk/chktex/chktex-src/deweb.in | 159 +++++++++++---------- Build/source/texk/chktex/configure | 22 +-- Build/source/texk/chktex/version.ac | 2 +- 23 files changed, 692 insertions(+), 161 deletions(-) delete mode 100644 Build/source/texk/chktex/chktex-PATCHES/patch-03-late-decl (limited to 'Build/source/texk/chktex') diff --git a/Build/source/texk/chktex/ChangeLog b/Build/source/texk/chktex/ChangeLog index e3d0dce9cee..44605686473 100644 --- a/Build/source/texk/chktex/ChangeLog +++ b/Build/source/texk/chktex/ChangeLog @@ -1,3 +1,9 @@ +2016-09-15 Akira Kakuto + + * Import ChkTeX 1.7.6. + * version.ac: adapted. + * ChkTeX.tex, ChkTeX.pdf: updated. + 2016-02-23 Akira Kakuto * Makefile.am, configure.ac: New convention. diff --git a/Build/source/texk/chktex/ChkTeX.pdf b/Build/source/texk/chktex/ChkTeX.pdf index 35c6f526ea3..443bb4f722c 100644 Binary files a/Build/source/texk/chktex/ChkTeX.pdf and b/Build/source/texk/chktex/ChkTeX.pdf differ diff --git a/Build/source/texk/chktex/ChkTeX.tex b/Build/source/texk/chktex/ChkTeX.tex index 2465f4a867b..4af94f9fca8 100644 --- a/Build/source/texk/chktex/ChkTeX.tex +++ b/Build/source/texk/chktex/ChkTeX.tex @@ -1,5 +1,5 @@ %% -%% ChkTeX v1.7.4, LaTeX documentation for ChkTeX program. +%% ChkTeX v1.7.6, LaTeX documentation for ChkTeX program. %% Copyright (C) 1995-96 Jens T. Berger Thielemann %% %% This program is free software; you can redistribute it and/or modify @@ -82,7 +82,7 @@ %endlatex -\title{\chktex\ v1.7.4} +\title{\chktex\ v1.7.6} \author{Jens~T. Berger~Thielemann} \date{\today} @@ -1145,7 +1145,7 @@ keyword in the \rsrc\ file which controls the discussed warning. \end{errexam} \end{errdesc} -\begin{errdesc}{You should use "'" (ASCII 39) instead of +\begin{errdesc*}{You should use "'" (ASCII 39) instead of "'" (ASCII 180).} On some keyboards you might get the wrong quote. This quote looks, IMHO, \emph{ugly} compared to the standard quotes, it doesn't even come out as a quote! Just see in the @@ -1160,7 +1160,7 @@ keyword in the \rsrc\ file which controls the discussed warning. \verb@``There's quotes and there's quotes''@ \\* ``There's quotes and there's quotes'' \\* \end{errexam} -\end{errdesc} +\end{errdesc*} \Keyword{UserWarn} \begin{errdesc}{User-specified pattern found: \%s.} @@ -1547,6 +1547,21 @@ keyword in the \rsrc\ file which controls the discussed warning. \end{errexam} \end{errdesc} +\begin{errdesc}{Use \textbackslash[ ... \textbackslash] instead of \$\$ ... \$\$.} + + In \LaTeX\ documents, using \verb+\[...\]+ is strongly preferred over \verb+$$...$$+. + This is because using \verb+$$+ will change the vertical spacing in the + equations making them inconsistent. + +\end{errdesc} + +\begin{errdesc*}{Use \textbackslash( ... \textbackslash) instead of \$ ... \$.} + + In \LaTeX\ documents using \verb+\(...\)+ is slightly preferred over \verb+$...$+. + Some error messages might be clearer with \verb+\(...\)+. + +\end{errdesc*} + \section{Future plans} In a somewhat prioritized sequence, this is what I'd like to put into the diff --git a/Build/source/texk/chktex/chktex-PATCHES/ChangeLog b/Build/source/texk/chktex/chktex-PATCHES/ChangeLog index ca3bfad642b..c7e2b208e5c 100644 --- a/Build/source/texk/chktex/chktex-PATCHES/ChangeLog +++ b/Build/source/texk/chktex/chktex-PATCHES/ChangeLog @@ -1,3 +1,8 @@ +2016-09-15 Akira Kakuto + + * Import chktex-1.7.6. + * patch-03-late-decl: remove, since now applied. + 2015-04-12 Karl Berry * Import chktex-1.7.4. diff --git a/Build/source/texk/chktex/chktex-PATCHES/TL-Changes b/Build/source/texk/chktex/chktex-PATCHES/TL-Changes index cfea26b511b..1a8db085335 100644 --- a/Build/source/texk/chktex/chktex-PATCHES/TL-Changes +++ b/Build/source/texk/chktex/chktex-PATCHES/TL-Changes @@ -1,6 +1,6 @@ -Changes applied to the chktex-1.7.4 tree as obtained from: +Changes applied to the chktex-1.7.6 tree as obtained from: http://mirror.ctan.org/support/chktex/ - http://download.savannah.gnu.org/releases/chktex/chktex-1.7.4.tar.gz + http://download.savannah.gnu.org/releases/chktex/chktex-1.7.6.tar.gz Remove: aclocal.m4 @@ -11,4 +11,3 @@ Remove: Rename: chkweb -> chkweb.sh - diff --git a/Build/source/texk/chktex/chktex-PATCHES/patch-03-late-decl b/Build/source/texk/chktex/chktex-PATCHES/patch-03-late-decl deleted file mode 100644 index 911c753a1d2..00000000000 --- a/Build/source/texk/chktex/chktex-PATCHES/patch-03-late-decl +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur chktex-1.7.4.orig/FindErrs.c chktex-1.7.4/FindErrs.c ---- chktex-1.7.4.orig/FindErrs.c 2015-04-11 20:37:49.000000000 +0200 -+++ chktex-1.7.4/FindErrs.c 2015-04-12 03:17:11.000000000 +0200 -@@ -1059,8 +1059,8 @@ - { - if ( *e == '-' && 0 == strncmp( BufPtr, e, strlen(e) ) ) - { -- TmpPtr = BufPtr; - char *f = e; -+ TmpPtr = BufPtr; - while ( f > exception && *(--f) == *(--TmpPtr) ) - { - /* Nothing */ diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.c b/Build/source/texk/chktex/chktex-src/ChkTeX.c index c83c0d84208..fd7812401a3 100644 --- a/Build/source/texk/chktex/chktex-src/ChkTeX.c +++ b/Build/source/texk/chktex/chktex-src/ChkTeX.c @@ -96,8 +96,9 @@ static const char *BigBanner = "ChkTeX comes with ABSOLUTELY NO WARRANTY; details on this and\n" "distribution conditions in the GNU General Public License file.\n" "Type \"ChkTeX -h\" for help, \"ChkTeX -i\" for distribution info.\n" - "Author: Jens Berger, Spektrumvn. 4, N-0666 Oslo, Norway.\n" - "E-mail: \n" + "Author: Jens Berger.\n" + "Bug reports: https://savannah.nongnu.org/bugs/?group=chktex\n" + " or darthandrus@gmail.com\n" "Press " STDIN_BREAK " to terminate stdin input.\n"; static const char *Distrib = @@ -337,7 +338,7 @@ static void ExpandTabs(char *From, char *To, long TSize, long MaxDiff) int main(int argc, char **argv) { - int retval = EXIT_FAILURE, CurArg; + int retval = EXIT_FAILURE, ret, CurArg; unsigned long Count; int StdInUse = FALSE; long Tab = 8; @@ -380,6 +381,7 @@ int main(int argc, char **argv) if ((CurArg = ParseArgs((unsigned long) argc, argv))) { + retval = EXIT_SUCCESS; if (CmdLine.Stack.Used) { ParseArgs(CmdLine.Stack.Used, (char **) CmdLine.Stack.Data); @@ -491,11 +493,13 @@ int main(int argc, char **argv) strcpy(ReadBuffer, TmpBuffer); strcat(ReadBuffer, " "); - FindErr(ReadBuffer, CurStkLine(&InputStack)); + ret = FindErr(ReadBuffer, CurStkLine(&InputStack)); + if ( ret != EXIT_SUCCESS ) { + retval = ret; + } } PrintStatus(CurStkLine(&InputStack)); - retval = EXIT_SUCCESS; } } } diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.h b/Build/source/texk/chktex/chktex-src/ChkTeX.h index a5865d6695a..01275d38b05 100644 --- a/Build/source/texk/chktex/chktex-src/ChkTeX.h +++ b/Build/source/texk/chktex/chktex-src/ChkTeX.h @@ -104,6 +104,10 @@ #if defined(__unix__) || defined(__unix) || defined(unix) #undef __unix__ #define __unix__ 1 +#elif defined(__APPLE__) && defined(__MACH__) +/* OS X should be considered a UNIX */ +#undef __unix__ +#define __unix__ 1 #elif defined(MSDOS) || defined(__MSDOS__) || defined(__msdos__) #undef __MSDOS__ #define __MSDOS__ 1 @@ -272,8 +276,8 @@ extern struct ErrMsg PrgMsgs[pmMaxFault + 1]; struct ErrInfo { char *Data; - const char *LineBuf; - const char *File; + char *LineBuf; + char *File; unsigned long Line, Column, ErrLen; enum { diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in b/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in index 3f68e866ca7..353322abfc0 100644 --- a/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in +++ b/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in @@ -1145,7 +1145,7 @@ keyword in the \rsrc\ file which controls the discussed warning. \end{errexam} \end{errdesc} -\begin{errdesc}{You should use "'" (ASCII 39) instead of +\begin{errdesc*}{You should use "'" (ASCII 39) instead of "'" (ASCII 180).} On some keyboards you might get the wrong quote. This quote looks, IMHO, \emph{ugly} compared to the standard quotes, it doesn't even come out as a quote! Just see in the @@ -1160,7 +1160,7 @@ keyword in the \rsrc\ file which controls the discussed warning. \verb@``There's quotes and there's quotes''@ \\* ``There's quotes and there's quotes'' \\* \end{errexam} -\end{errdesc} +\end{errdesc*} \Keyword{UserWarn} \begin{errdesc}{User-specified pattern found: \%s.} @@ -1547,6 +1547,21 @@ keyword in the \rsrc\ file which controls the discussed warning. \end{errexam} \end{errdesc} +\begin{errdesc}{Use \textbackslash[ ... \textbackslash] instead of \$\$ ... \$\$.} + + In \LaTeX\ documents, using \verb+\[...\]+ is strongly preferred over \verb+$$...$$+. + This is because using \verb+$$+ will change the vertical spacing in the + equations making them inconsistent. + +\end{errdesc} + +\begin{errdesc*}{Use \textbackslash( ... \textbackslash) instead of \$ ... \$.} + + In \LaTeX\ documents using \verb+\(...\)+ is slightly preferred over \verb+$...$+. + Some error messages might be clearer with \verb+\(...\)+. + +\end{errdesc*} + \section{Future plans} In a somewhat prioritized sequence, this is what I'd like to put into the diff --git a/Build/source/texk/chktex/chktex-src/FindErrs.c b/Build/source/texk/chktex/chktex-src/FindErrs.c index bac161f66a6..f1a470b8238 100644 --- a/Build/source/texk/chktex/chktex-src/FindErrs.c +++ b/Build/source/texk/chktex/chktex-src/FindErrs.c @@ -51,6 +51,10 @@ int NumRegexes = 0; #endif +int FoundErr = EXIT_SUCCESS; +int LastWasComment = FALSE; +int SeenSpace = FALSE; + /***************************** ERROR MESSAGES ***************************/ #undef MSG @@ -148,7 +152,6 @@ static uint64_t UserLineSuppressions; static unsigned long Line; static const char *RealBuf; -static char *LineCpy = NULL; static char *BufPtr; static int ItFlag = efNone; @@ -292,17 +295,6 @@ static char *GetLTXArg(char *SrcBuf, char *OrigDest, const int Until, } -static char *MakeCpy(void) -{ - if (!LineCpy) - LineCpy = strdup(RealBuf); - - if (!LineCpy) - PrintPrgErr(pmStrDupErr); - - return (LineCpy); -} - static char *PreProcess(void) { char *TmpPtr; @@ -317,6 +309,7 @@ static char *PreProcess(void) TmpPtr = Buf; + LastWasComment = FALSE; while ((TmpPtr = strchr(TmpPtr, '%'))) { char *EscapePtr = TmpPtr; @@ -330,6 +323,7 @@ static char *PreProcess(void) /* If there is an even number of backslashes, then it's a comment. */ if ((NumBackSlashes % 2) == 0) { + LastWasComment = TRUE; PSERR(TmpPtr - Buf, 1, emComment); *TmpPtr = 0; /* Check for line suppressions */ @@ -668,7 +662,7 @@ static void PerformBigCmd(char *CmdPtr) if (CmdBuffer[1] == 'b') { if (!(PushErr(ArgBuffer, Line, CmdPtr - Buf, - CmdLen, MakeCpy(), &EnvStack))) + CmdLen, RealBuf, &EnvStack))) PrintPrgErr(pmNoStackMem); } else @@ -703,7 +697,7 @@ static void PerformBigCmd(char *CmdPtr) { TmpPtr = CmdBuffer + 6; if (!(PushErr(TmpPtr, Line, CmdPtr - Buf + 6, - CmdLen - 6, MakeCpy(), &EnvStack))) + CmdLen - 6, RealBuf, &EnvStack))) PrintPrgErr(pmNoStackMem); } else @@ -851,12 +845,15 @@ static void CheckRest(void) { CommentEnd = strchr(pattern, ')'); /* TODO: check for PCRE/POSIX only regexes */ - *CommentEnd = '\0'; - /* We're leaking a little here, but this was never freed until exit anyway... */ - UserWarnRegex.Stack.Data[NumRegexes] = pattern+3; + if ( CommentEnd != NULL ) + { + *CommentEnd = '\0'; + /* We're leaking a little here, but this was never freed until exit anyway... */ + UserWarnRegex.Stack.Data[NumRegexes] = pattern+3; - /* Compile past the end of the comment so that it works with POSIX too. */ - pattern = CommentEnd + 1; + /* Compile past the end of the comment so that it works with POSIX too. */ + pattern = CommentEnd + 1; + } } /* Ignore PCRE and POSIX specific regexes. @@ -958,7 +955,17 @@ static void CheckRest(void) (int)(MATCH.rm_eo - MATCH.rm_so), TmpBuffer + offset + MATCH.rm_so); } - offset += MATCH.rm_eo; + if ( MATCH.rm_eo == 0 ) + { + /* Break out of loop if the match was empty. + * This avoids an infinite loop when the match + * is empty, e.g $ */ + offset = len; + } + else + { + offset += MATCH.rm_eo; + } #undef MATCH } } @@ -1164,7 +1171,7 @@ static void HandleBracket(char Char) else /* Opening bracket of some sort */ { if ((ei = PushChar(Char, Line, BufPtr - Buf - 1, - &CharStack, MakeCpy()))) + &CharStack, RealBuf))) { if (Char == '{') { @@ -1309,15 +1316,33 @@ int FindErr(const char *_RealBuf, const unsigned long _Line) enum DotLevel dotlev; + FoundErr = EXIT_SUCCESS; + if (_RealBuf) { RealBuf = _RealBuf; Line = _Line; + if (!LastWasComment) + { + SeenSpace = TRUE; + } BufPtr = PreProcess(); BufPtr = SkipVerb(); + /* Skip past leading whitespace which is insignificant in TeX to avoid + * spurious warnings (Delete this space to maintain correct + * pagereferences). If we have seen a space we don't _need_ to skip + * past, and doing so misses Message 30 (Multiple spaces detected). We + * can miss some of Message 30 in the "not SeenSpace" case too, but I + * think it's less important, since Message 30 is for newbies. + */ + if (!SeenSpace && BufPtr) + { + SKIP_AHEAD(BufPtr, TmpC, LATEX_SPACE(TmpC)); + } + while (BufPtr && *BufPtr) { PrePtr = BufPtr - 1; @@ -1623,12 +1648,18 @@ int FindErr(const char *_RealBuf, const unsigned long _Line) case '\\': /* Command encountered */ BufPtr = GetLTXToken(--BufPtr, CmdBuffer); - if (LATEX_SPACE(*PrePtr)) + if (SeenSpace) { + /* We must be careful to not point to the "previous space" + * when it was actually on the previous line. This could + * cause us to write into someone else's memory (inside of + * PrintError). */ if (HasWord(CmdBuffer, &Linker)) - PSERR(PrePtr - Buf, 1, emNBSpace); + PSERR( (PrePtr > Buf) ? (PrePtr - Buf) : 0, + 1, emNBSpace); if (HasWord(CmdBuffer, &PostLink)) - PSERR(PrePtr - Buf, 1, emFalsePage); + PSERR( (PrePtr > Buf) ? (PrePtr - Buf) : 0, + 1, emFalsePage); } if (LATEX_SPACE(*BufPtr) && !MathMode && @@ -1683,12 +1714,25 @@ int FindErr(const char *_RealBuf, const unsigned long _Line) if (*PrePtr != '\\') { if (*BufPtr == '$') + { BufPtr++; + TmpPtr = BufPtr; + SKIP_AHEAD(TmpPtr, TmpC, (TmpC != '$' && TmpC != '\0')); + PSERR(BufPtr - Buf - 2, TmpPtr-BufPtr+4, emDisplayMath); + } + else + { + TmpPtr = BufPtr; + SKIP_AHEAD(TmpPtr, TmpC, (TmpC != '$' && TmpC != '\0')); + PSERR(BufPtr - Buf - 1, TmpPtr-BufPtr+2, emInlineMath); + } MathMode ^= TRUE; } break; } + + SeenSpace = LATEX_SPACE(Char); } if (!VerbMode) @@ -1698,13 +1742,7 @@ int FindErr(const char *_RealBuf, const unsigned long _Line) } - /* Free and reset LineCpy if it was used */ - if ( LineCpy != NULL ) - { - free(LineCpy); - LineCpy = NULL; - } - return (TRUE); + return FoundErr; } /* @@ -1834,6 +1872,7 @@ PrintError(const char *File, const char *String, } else { + FoundErr = EXIT_FAILURE; Context = LaTeXMsgs[Error].Context; if (!HeadErrOut) diff --git a/Build/source/texk/chktex/chktex-src/FindErrs.h b/Build/source/texk/chktex/chktex-src/FindErrs.h index 9932d93e861..df38559ba36 100644 --- a/Build/source/texk/chktex/chktex-src/FindErrs.h +++ b/Build/source/texk/chktex/chktex-src/FindErrs.h @@ -124,7 +124,11 @@ MSG(emNoCharMean, etWarn, iuOK, ctNone,\ "`%s' is normally not followed by `%c'.")\ MSG(emUserWarnRegex, etWarn, iuOK, ctNone,\ - "User Regex: %.*s.") + "User Regex: %.*s.") \ + MSG(emDisplayMath, etWarn, iuOK, ctOutMath,\ + "Use \\[ ... \\] instead of $$ ... $$.")\ + MSG(emInlineMath, etWarn, iuNotSys, ctOutMath,\ + "Use \\( ... \\) instead of $ ... $.") #undef MSG #define MSG(num, type, inuse, ctxt, text) num, diff --git a/Build/source/texk/chktex/chktex-src/Makefile.in b/Build/source/texk/chktex/chktex-src/Makefile.in index aef68eeab70..8980880ea34 100644 --- a/Build/source/texk/chktex/chktex-src/Makefile.in +++ b/Build/source/texk/chktex/chktex-src/Makefile.in @@ -124,7 +124,7 @@ endif OBJS= ChkTeX.o FindErrs.o OpSys.o Resource.o Utility.o -MAKETEST= (builddir=`pwd` ; cd $(srcdir) ; $${builddir}/chktex -mall -r -g0 -lchktexrc -v5 Test.tex) +MAKETEST= (builddir=`pwd` ; cd $(srcdir) ; $${builddir}/chktex -mall -r -g0 -lchktexrc -v5 Test.tex || :) # We can't grep the output of chtex because it might not be built yet TestOutFile := $(shell sed -n 's/.*HAVE_\(.*RE\) 1.*/\1/p' config.h | tr "A-Z_" "a-z-") @@ -321,3 +321,6 @@ Post: %t*N\ -./chktex -w30 Test.tex -./chktex -g --localrc=.testrc -d2 Test.tex for file in $(CSOURCES); do gcov $(GCOVOPTS) $$file; done + +valgrind: chktex + valgrind --tool=memcheck --leak-check=full chktex -mall -r -g0 -lchktexrc -v5 Test.tex | grep ^[-=][-=] diff --git a/Build/source/texk/chktex/chktex-src/NEWS b/Build/source/texk/chktex/chktex-src/NEWS index 6c80774e33b..14c389b6b89 100644 --- a/Build/source/texk/chktex/chktex-src/NEWS +++ b/Build/source/texk/chktex/chktex-src/NEWS @@ -1,6 +1,25 @@ 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.6 (2016-09-09), released by Ivan Andrus + + * Properly copy and free strings. This caused incorrect file + reporting in some cases #49000 + * Add "verbatim" commands and environments from tipa #46734 + * Avoid infinite loop when a regex matches an empty string + * Fix crash on invalid regular expression + * Add warnings for $$...$$ and $...$ #47044 + * Update the banner to reflect current bug reporting contacts + +1.7.5 (2015-12-07), released by Ivan Andrus + + * Track whether the previous line ended in a comment #45980 + * Add a few source code environments to VerbEnvir + * Don't show long line warning if the last line doesn't have a newline #46539 + * Fix deweb's handling of file names #46043,#46042 + * Use the exit status to indicate warnings were found #45979 + * Consider OS X a UNIX + 1.7.4 (2015-04-11), released by Ivan Andrus * Fixed undefined behavior (patch from TeXLive) diff --git a/Build/source/texk/chktex/chktex-src/Test.nore.out b/Build/source/texk/chktex/chktex-src/Test.nore.out index 96c3b28d9a2..44e35715001 100644 --- a/Build/source/texk/chktex/chktex-src/Test.nore.out +++ b/Build/source/texk/chktex/chktex-src/Test.nore.out @@ -14,6 +14,12 @@ Message 1 in Test.tex: Command terminated with space. \foo This is an error. ^ Message 1 in Test.tex: Command terminated with space. +So is this \foo + ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\smallskip This is a not. $\foo Neither$ is this. + ^^^^^^^^^^^^^^ +Message 1 in Test.tex: Command terminated with space. \stoptext ^ Message 9 in Test.tex: `section' expected, found `text'. @@ -28,6 +34,9 @@ This is a faulty reference to \ref{foo} Message 22 in Test.tex: Comment displayed. % Warning 3 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$[(ab)^{-1}]^{-2}$ is not beautiful +^^^^^^^^^^^^^^^^^^ Message 3 in Test.tex: You should enclose the previous parenthesis with `{}'. $[(ab)^{-1}]^{-2}$ is not beautiful ^ @@ -37,6 +46,9 @@ $[(ab)^{-1}]^{-2}$ is not beautiful Message 30 in Test.tex: Multiple spaces detected in input. $[(ab)^{-1}]^{-2}$ is not beautiful ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +${{[{(ab)}^{-1}]}}^{-2}$ is beautiful +^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 4-6, 28 ^ @@ -88,9 +100,15 @@ Message 22 in Test.tex: Comment displayed. Message 7 in Test.tex: Accent command `\'' needs use of `\i'. This \'is a test of $\hat{j}$ accents. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'is a test of $\hat{j}$ accents. + ^^^^^^^^^ Message 7 in Test.tex: Accent command `\hat' needs use of `\jmath'. This \'is a test of $\hat{j}$ accents. ^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'{\i}s a test of $\hat{\jmath}$ accents. + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 8 ^ @@ -181,18 +199,42 @@ Message 22 in Test.tex: Comment displayed. Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 12 ^ @@ -275,11 +317,26 @@ Message 24 in Test.tex: Delete this space to maintain correct pagereferences. Indexing text \index{text} is fun! ^ Message 22 in Test.tex: Comment displayed. +Indexing text% + ^ +Message 30 in Test.tex: Multiple spaces detected in input. + \index{text} is fun! + ^^^^ +Message 24 in Test.tex: Delete this space to maintain correct pagereferences. + \index{text} is fun! + ^ +Message 22 in Test.tex: Comment displayed. % Warning 25 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^10$ +^^^^^^^^^^^^^ Message 25 in Test.tex: You might wish to put this between a pair of `{}' $5\cdot10^10$ ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^{10}$ +^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 26 ^ @@ -307,6 +364,9 @@ Message 22 in Test.tex: Comment displayed. Message 29 in Test.tex: $\times$ may look prettier here. The program opens a screen sized 640x200 pixels ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +The program opens a screen sized $640\times200$ pixels + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 30 ^ @@ -343,12 +403,18 @@ This is either an 'example`, an ''example`` or an `"`example'`'. Message 22 in Test.tex: Comment displayed. % Warning 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$sin^2 + cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. $sin^2 + cos^2 = 1$ ^^^ Message 35 in Test.tex: You should perhaps use `\cos' instead. $sin^2 + cos^2 = 1$ ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\sin^2 + \cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 36-37 ^ @@ -394,12 +460,24 @@ For output codes, see table ~\ref{tab:fmtout}. Message 22 in Test.tex: Comment displayed. % Warning 40 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this,$ and $$this$$. +^^^^^^^^ Message 40 in Test.tex: You should put punctuation outside inner math mode. $\this,$ and $$this$$. ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this,$ and $$this$$. + ^^^^^^^^ Message 40 in Test.tex: You should put punctuation inside display math mode. $\this,$ and $$this$$. ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this$, and $$this.$$ +^^^^^^^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this$, and $$this.$$ + ^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 41 ^ @@ -418,36 +496,66 @@ This is a footnote \footnote{foo}. Message 22 in Test.tex: Comment displayed. % Warning 43 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here is a mistake $\left{x\right}$. + ^^^^^^^^^^^^^^^^ Message 43 in Test.tex: `\left' is normally not followed by `{'. Here is a mistake $\left{x\right}$. ^^^^^ Message 43 in Test.tex: `\right' is normally not followed by `}'. Here is a mistake $\left{x\right}$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This one triggers warning 22 $\left\{x\right\}$. + ^^^^^^^^^^^^^^^^^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here \chktex\ doesn't complain $\left\lbrace x\right\rbrace$. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- default message ^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- user message ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^ Message 22 in Test.tex: Comment displayed. % Math mode check ^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} + ^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 36 in Test.tex: You should put a space in front of parenthesis. Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^ Message 22 in Test.tex: Comment displayed. This is\\% a comment. Nothing here should be checked(right)? ^ @@ -457,6 +565,9 @@ But this is not a \% comment, so we should find this error(right)? Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 + ^^^^^^^^ Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ @@ -466,6 +577,9 @@ Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 Message 36 in Test.tex: You should put a space after parenthesis. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 + ^^^^^^^^ Message 22 in Test.tex: Comment displayed. In section~\ref{sec:4} it is suppressed. % chktex -1 ^ @@ -484,6 +598,21 @@ Message 31 in Test.tex: This text may be ignored. Message 22 in Test.tex: Comment displayed. % Warning 16,15 ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$$( +^^^^^^^ +Message 22 in Test.tex: Comment displayed. +% Local Variables: +^ +Message 22 in Test.tex: Comment displayed. +% require-final-newline: nil +^ +Message 22 in Test.tex: Comment displayed. +% End: +^ +Message 22 in Test.tex: Comment displayed. +% There should be no newline at the end of this file to test bug #46539 +^ Message 16 in Test.tex: Mathmode still on at end of LaTeX file. diff --git a/Build/source/texk/chktex/chktex-src/Test.pcre.out b/Build/source/texk/chktex/chktex-src/Test.pcre.out index 923b84199d4..c2e8eefac25 100644 --- a/Build/source/texk/chktex/chktex-src/Test.pcre.out +++ b/Build/source/texk/chktex/chktex-src/Test.pcre.out @@ -13,6 +13,12 @@ Message 22 in Test.tex: Comment displayed. Message 1 in Test.tex: Command terminated with space. \foo This is an error. ^ +Message 1 in Test.tex: Command terminated with space. +So is this \foo + ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\smallskip This is a not. $\foo Neither$ is this. + ^^^^^^^^^^^^^^ Message 9 in Test.tex: `section' expected, found `text'. \stoptext ^^^^ @@ -25,6 +31,9 @@ This is a faulty reference to \ref{foo} Message 22 in Test.tex: Comment displayed. % Warning 3 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$[(ab)^{-1}]^{-2}$ is not beautiful +^^^^^^^^^^^^^^^^^^ Message 3 in Test.tex: You should enclose the previous parenthesis with `{}'. $[(ab)^{-1}]^{-2}$ is not beautiful ^ @@ -34,6 +43,9 @@ $[(ab)^{-1}]^{-2}$ is not beautiful Message 30 in Test.tex: Multiple spaces detected in input. $[(ab)^{-1}]^{-2}$ is not beautiful ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +${{[{(ab)}^{-1}]}}^{-2}$ is beautiful +^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 4-6, 28 ^ @@ -85,9 +97,15 @@ Message 22 in Test.tex: Comment displayed. Message 7 in Test.tex: Accent command `\'' needs use of `\i'. This \'is a test of $\hat{j}$ accents. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'is a test of $\hat{j}$ accents. + ^^^^^^^^^ Message 7 in Test.tex: Accent command `\hat' needs use of `\jmath'. This \'is a test of $\hat{j}$ accents. ^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'{\i}s a test of $\hat{\jmath}$ accents. + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 8 ^ @@ -178,18 +196,42 @@ Message 22 in Test.tex: Comment displayed. Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 12 ^ @@ -272,11 +314,26 @@ Message 24 in Test.tex: Delete this space to maintain correct pagereferences. Indexing text \index{text} is fun! ^ Message 22 in Test.tex: Comment displayed. +Indexing text% + ^ +Message 30 in Test.tex: Multiple spaces detected in input. + \index{text} is fun! + ^^^^ +Message 24 in Test.tex: Delete this space to maintain correct pagereferences. + \index{text} is fun! + ^ +Message 22 in Test.tex: Comment displayed. % Warning 25 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^10$ +^^^^^^^^^^^^^ Message 25 in Test.tex: You might wish to put this between a pair of `{}' $5\cdot10^10$ ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^{10}$ +^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 26 ^ @@ -304,6 +361,9 @@ Message 22 in Test.tex: Comment displayed. Message 29 in Test.tex: $\times$ may look prettier here. The program opens a screen sized 640x200 pixels ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +The program opens a screen sized $640\times200$ pixels + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 30 ^ @@ -340,12 +400,18 @@ This is either an 'example`, an ''example`` or an `"`example'`'. Message 22 in Test.tex: Comment displayed. % Warning 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$sin^2 + cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. $sin^2 + cos^2 = 1$ ^^^ Message 35 in Test.tex: You should perhaps use `\cos' instead. $sin^2 + cos^2 = 1$ ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\sin^2 + \cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 36-37 ^ @@ -391,12 +457,24 @@ For output codes, see table ~\ref{tab:fmtout}. Message 22 in Test.tex: Comment displayed. % Warning 40 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this,$ and $$this$$. +^^^^^^^^ Message 40 in Test.tex: You should put punctuation outside inner math mode. $\this,$ and $$this$$. ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this,$ and $$this$$. + ^^^^^^^^ Message 40 in Test.tex: You should put punctuation inside display math mode. $\this,$ and $$this$$. ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this$, and $$this.$$ +^^^^^^^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this$, and $$this.$$ + ^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 41 ^ @@ -415,39 +493,69 @@ This is a footnote \footnote{foo}. Message 22 in Test.tex: Comment displayed. % Warning 43 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here is a mistake $\left{x\right}$. + ^^^^^^^^^^^^^^^^ Message 43 in Test.tex: `\left' is normally not followed by `{'. Here is a mistake $\left{x\right}$. ^^^^^ Message 43 in Test.tex: `\right' is normally not followed by `}'. Here is a mistake $\left{x\right}$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This one triggers warning 22 $\left\{x\right\}$. + ^^^^^^^^^^^^^^^^^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here \chktex\ doesn't complain $\left\lbrace x\right\rbrace$. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- default message ^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- user message ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^ Message 44 in Test.tex: User Regex: Always use \nmid. For every $p\not|n$ you have an ugly prime which doesn't divide $n$. ^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^ Message 22 in Test.tex: Comment displayed. % Math mode check ^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} + ^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 36 in Test.tex: You should put a space in front of parenthesis. Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^ Message 22 in Test.tex: Comment displayed. This is\\% a comment. Nothing here should be checked(right)? ^ @@ -457,6 +565,9 @@ But this is not a \% comment, so we should find this error(right)? Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 + ^^^^^^^^ Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ @@ -466,6 +577,9 @@ Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 Message 36 in Test.tex: You should put a space after parenthesis. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 + ^^^^^^^^ Message 44 in Test.tex: User Regex: -1:Capitalize before references. In section~\ref{sec:3} we have a warning. ^^^^^^^^^^^^ @@ -493,6 +607,21 @@ Message 31 in Test.tex: This text may be ignored. Message 22 in Test.tex: Comment displayed. % Warning 16,15 ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$$( +^^^^^^^ +Message 22 in Test.tex: Comment displayed. +% Local Variables: +^ +Message 22 in Test.tex: Comment displayed. +% require-final-newline: nil +^ +Message 22 in Test.tex: Comment displayed. +% End: +^ +Message 22 in Test.tex: Comment displayed. +% There should be no newline at the end of this file to test bug #46539 +^ Message 16 in Test.tex: Mathmode still on at end of LaTeX file. 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 6cdc394ef55..c89ce369365 100644 --- a/Build/source/texk/chktex/chktex-src/Test.posix-ere.out +++ b/Build/source/texk/chktex/chktex-src/Test.posix-ere.out @@ -13,6 +13,12 @@ Message 22 in Test.tex: Comment displayed. Message 1 in Test.tex: Command terminated with space. \foo This is an error. ^ +Message 1 in Test.tex: Command terminated with space. +So is this \foo + ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\smallskip This is a not. $\foo Neither$ is this. + ^^^^^^^^^^^^^^ Message 9 in Test.tex: `section' expected, found `text'. \stoptext ^^^^ @@ -25,6 +31,9 @@ This is a faulty reference to \ref{foo} Message 22 in Test.tex: Comment displayed. % Warning 3 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$[(ab)^{-1}]^{-2}$ is not beautiful +^^^^^^^^^^^^^^^^^^ Message 3 in Test.tex: You should enclose the previous parenthesis with `{}'. $[(ab)^{-1}]^{-2}$ is not beautiful ^ @@ -34,6 +43,9 @@ $[(ab)^{-1}]^{-2}$ is not beautiful Message 30 in Test.tex: Multiple spaces detected in input. $[(ab)^{-1}]^{-2}$ is not beautiful ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +${{[{(ab)}^{-1}]}}^{-2}$ is beautiful +^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 4-6, 28 ^ @@ -85,9 +97,15 @@ Message 22 in Test.tex: Comment displayed. Message 7 in Test.tex: Accent command `\'' needs use of `\i'. This \'is a test of $\hat{j}$ accents. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'is a test of $\hat{j}$ accents. + ^^^^^^^^^ Message 7 in Test.tex: Accent command `\hat' needs use of `\jmath'. This \'is a test of $\hat{j}$ accents. ^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This \'{\i}s a test of $\hat{\jmath}$ accents. + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 8 ^ @@ -178,18 +196,42 @@ Message 22 in Test.tex: Comment displayed. Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^ Message 11 in Test.tex: You should use \ldots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 11 in Test.tex: You should use \cdots to achieve an ellipsis. Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$. + ^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 12 ^ @@ -272,11 +314,26 @@ Message 24 in Test.tex: Delete this space to maintain correct pagereferences. Indexing text \index{text} is fun! ^ Message 22 in Test.tex: Comment displayed. +Indexing text% + ^ +Message 30 in Test.tex: Multiple spaces detected in input. + \index{text} is fun! + ^^^^ +Message 24 in Test.tex: Delete this space to maintain correct pagereferences. + \index{text} is fun! + ^ +Message 22 in Test.tex: Comment displayed. % Warning 25 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^10$ +^^^^^^^^^^^^^ Message 25 in Test.tex: You might wish to put this between a pair of `{}' $5\cdot10^10$ ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$5\cdot10^{10}$ +^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 26 ^ @@ -304,6 +361,9 @@ Message 22 in Test.tex: Comment displayed. Message 29 in Test.tex: $\times$ may look prettier here. The program opens a screen sized 640x200 pixels ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +The program opens a screen sized $640\times200$ pixels + ^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 30 ^ @@ -340,12 +400,18 @@ This is either an 'example`, an ''example`` or an `"`example'`'. Message 22 in Test.tex: Comment displayed. % Warning 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$sin^2 + cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. $sin^2 + cos^2 = 1$ ^^^ Message 35 in Test.tex: You should perhaps use `\cos' instead. $sin^2 + cos^2 = 1$ ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\sin^2 + \cos^2 = 1$ +^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 36-37 ^ @@ -391,12 +457,24 @@ For output codes, see table ~\ref{tab:fmtout}. Message 22 in Test.tex: Comment displayed. % Warning 40 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this,$ and $$this$$. +^^^^^^^^ Message 40 in Test.tex: You should put punctuation outside inner math mode. $\this,$ and $$this$$. ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this,$ and $$this$$. + ^^^^^^^^ Message 40 in Test.tex: You should put punctuation inside display math mode. $\this,$ and $$this$$. ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +$\this$, and $$this.$$ +^^^^^^^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$\this$, and $$this.$$ + ^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 41 ^ @@ -415,39 +493,69 @@ This is a footnote \footnote{foo}. Message 22 in Test.tex: Comment displayed. % Warning 43 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here is a mistake $\left{x\right}$. + ^^^^^^^^^^^^^^^^ Message 43 in Test.tex: `\left' is normally not followed by `{'. Here is a mistake $\left{x\right}$. ^^^^^ Message 43 in Test.tex: `\right' is normally not followed by `}'. Here is a mistake $\left{x\right}$. ^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +This one triggers warning 22 $\left\{x\right\}$. + ^^^^^^^^^^^^^^^^^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ Message 21 in Test.tex: This command might not be intended. This one triggers warning 22 $\left\{x\right\}$. ^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here \chktex\ doesn't complain $\left\lbrace x\right\rbrace$. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- default message ^ Message 22 in Test.tex: Comment displayed. % Warning 44 -- user regex -- user message ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\not|n$ you have an ugly prime which doesn't divide $n$. + ^^^ Message 44 in Test.tex: User Regex: Always use \nmid. For every $p\not|n$ you have an ugly prime which doesn't divide $n$. ^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^^^^^^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +For every $p\nmid n$ you have a cute prime which doesn't divide $n$. + ^^^ Message 22 in Test.tex: Comment displayed. % Math mode check ^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +\ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} + ^^^^^^^ Message 35 in Test.tex: You should perhaps use `\sin' instead. \ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}} ^^^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Message 36 in Test.tex: You should put a space in front of parenthesis. Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Also, $x(3)\text{ is not x(3) but it is $x(3)$}$ + ^^^^^^ Message 22 in Test.tex: Comment displayed. This is\\% a comment. Nothing here should be checked(right)? ^ @@ -457,6 +565,9 @@ But this is not a \% comment, so we should find this error(right)? Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % chktex 36 chktex 35 + ^^^^^^^^ Message 22 in Test.tex: Comment displayed. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ @@ -466,6 +577,9 @@ Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 Message 36 in Test.tex: You should put a space after parenthesis. Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 ^ +Message 46 in Test.tex: Use \( ... \) instead of $ ... $. +Here(on this line only)is a warning $sin(x)$ suppressed. % CHKTEX 35 36 + ^^^^^^^^ Message 44 in Test.tex: User Regex: 1:Capitalize before references. In section~\ref{sec:3} we have a warning. ^^^^^^^^^^^^^ @@ -493,6 +607,21 @@ Message 31 in Test.tex: This text may be ignored. Message 22 in Test.tex: Comment displayed. % Warning 16,15 ^ +Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$. +$$( +^^^^^^^ +Message 22 in Test.tex: Comment displayed. +% Local Variables: +^ +Message 22 in Test.tex: Comment displayed. +% require-final-newline: nil +^ +Message 22 in Test.tex: Comment displayed. +% End: +^ +Message 22 in Test.tex: Comment displayed. +% There should be no newline at the end of this file to test bug #46539 +^ Message 16 in Test.tex: Mathmode still on at end of LaTeX file. diff --git a/Build/source/texk/chktex/chktex-src/Test.tex b/Build/source/texk/chktex/chktex-src/Test.tex index 376ea0d5e0c..9a7fc05fa04 100644 --- a/Build/source/texk/chktex/chktex-src/Test.tex +++ b/Build/source/texk/chktex/chktex-src/Test.tex @@ -10,6 +10,7 @@ are nonsense in a TeXnical manner. % Warning 1 \foo This is an error. +So is this \foo \smallskip This is a not. $\foo Neither$ is this. \startsection[title={Testing ConTeXt}] @@ -113,6 +114,10 @@ That bug is \unknown\ to me. Indexing text \index{text} is fun! Indexing text\index{text} is fun! +Indexing text% + \index{text} is fun! +Indexing text + \index{text} is fun! % Warning 25 @@ -225,3 +230,8 @@ In section~\ref{sec:4} it is suppressed. % chktex -1 % Warning 16,15 $$( + +% Local Variables: +% require-final-newline: nil +% End: +% There should be no newline at the end of this file to test bug #46539 \ No newline at end of file diff --git a/Build/source/texk/chktex/chktex-src/Utility.c b/Build/source/texk/chktex/chktex-src/Utility.c index 0f7c6c073df..6f05e98f617 100644 --- a/Build/source/texk/chktex/chktex-src/Utility.c +++ b/Build/source/texk/chktex/chktex-src/Utility.c @@ -727,6 +727,7 @@ char *FGetsStk(char *Dest, unsigned long len, struct Stack *stack) static short HasSeenLong = 0; struct FileNode *fn; char *Retval = NULL; + size_t Retlen = 0; if ((fn = StkTop(stack))) { @@ -734,12 +735,14 @@ char *FGetsStk(char *Dest, unsigned long len, struct Stack *stack) { Retval = fgets(Dest, (int)len, fn->fh); if (Retval) { - if (Retval[strlen(Retval)-1] == '\n') + Retlen = strlen(Retval); + + if (Retval[Retlen-1] == '\n' || Retlen < len-1) fn->Line++; /* We only want the long lines warning once per file */ else if (!HasSeenLong) { - PrintPrgErr(pmLongLines, BUFSIZ); + PrintPrgErr(pmLongLines, len-2); HasSeenLong = 1; } break; @@ -833,15 +836,29 @@ struct ErrInfo *PushErr(const char *Data, const unsigned long Line, { if ((ci->Data = strdup(Data))) { - ci->File = CurStkName(&InputStack); - ci->Line = Line; - ci->ErrLen = ErrLen; - ci->Column = Column; - ci->LineBuf = LineCpy; - ci->Flags = efNone; - - if (StkPush(ci, Stk)) - return (ci); + if ((ci->File = strdup(CurStkName(&InputStack)))) + { + if ((ci->LineBuf = strdup(LineCpy))) + { + ci->Line = Line; + ci->ErrLen = ErrLen; + ci->Column = Column; + ci->Flags = efNone; + + if (StkPush(ci, Stk)) + return (ci); + + free(ci->LineBuf); + } + else + PrintPrgErr(pmStrDupErr); + + free(ci->File); + } + else + PrintPrgErr(pmStrDupErr); + + free(ci->Data); } else PrintPrgErr(pmStrDupErr); @@ -906,6 +923,10 @@ void FreeErrInfo(struct ErrInfo *ei) { if (ei->Data) free(ei->Data); + if (ei->File) + free(ei->File); + if (ei->LineBuf) + free(ei->LineBuf); free(ei); } diff --git a/Build/source/texk/chktex/chktex-src/chktexrc b/Build/source/texk/chktex/chktex-src/chktexrc index da28a5dcfad..c6355f8db12 100644 --- a/Build/source/texk/chktex/chktex-src/chktexrc +++ b/Build/source/texk/chktex/chktex-src/chktexrc @@ -493,6 +493,8 @@ WipeArg \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{} \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{} \citetext:{} \citeyear:*{} \citeyearpar:{} + # tipa which uses " + \textipa:{} } ##################################################################### @@ -545,7 +547,7 @@ TextCmd VerbEnvir { verbatim comment listing verbatimtab rawhtml errexam picture texdraw - filecontents pgfpicture tikzpicture + filecontents pgfpicture tikzpicture minted lstlisting IPA } ##################################################################### diff --git a/Build/source/texk/chktex/chktex-src/configure.in b/Build/source/texk/chktex/chktex-src/configure.in index 7c982872371..0508bcac258 100644 --- a/Build/source/texk/chktex/chktex-src/configure.in +++ b/Build/source/texk/chktex/chktex-src/configure.in @@ -27,7 +27,7 @@ dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT(ChkTeX, 1.7.4) +AC_INIT(ChkTeX, 1.7.6) AC_SUBST(SCRIPTS) AC_SUBST(BUILT_SCRIPTS) AC_SUBST(CLEAN) diff --git a/Build/source/texk/chktex/chktex-src/deweb.in b/Build/source/texk/chktex/chktex-src/deweb.in index 91750e636a2..fff7fb919a2 100644 --- a/Build/source/texk/chktex/chktex-src/deweb.in +++ b/Build/source/texk/chktex/chktex-src/deweb.in @@ -26,93 +26,104 @@ # # -print STDERR "DeWEB v1.2 - Copyright 1996 Jens T. Berger Thielemann\n"; +print STDERR "DeWEB v1.3 - Copyright 1996 Jens T. Berger Thielemann\n"; undef $/; -$texmode = 1; -$_ = <>; - -while(/\@/) -{ - &out($`); - $_ = $'; - - if(/^@/) { - $_ = $'; - &out('@'); - next; +my @FILES = @ARGV; +FILE: +while( my $file = shift @FILES ) { + + my $success = open my $fh, '<', "$file"; + if ( ! $success ) { + print STDERR "Couldn't open file '$file'\n"; + next FILE; } - if(/^([\s\n])/) { - $_ = $'; - print "\n" if $1 eq "\n"; - $texmode = 1; - next; - } - - if(/^[cpd]/i) { - $_ = $'; - $texmode = 0; - next; - } - - if(/^\,/i) { - $_ = $'; - print '\,'; - next; - } - - if(m!^/!) { - $_ = $'; - print '\\\\'; - next; - } - - if(/^[h\&\|\;\#\+]/i || /^i.*/i) { - $_ = $'; - next; - } - - if(/^\*[0-9\*]?((.|\n)*?\.)/) { - $_ = $'; - print $1; - $texmode = 1; - next; - } - - if(/^[<(^.t!]((.|\n)*?)\@\>/i) { - $_ = $'; - print '{'.$1.'}'; - $texmode = 0; - next; - } - - if(/^[=]((.|\n)*?)\@\>/) { - $_ = $'; - print &printnl($1); - next; - } + $texmode = 1; + $_ = <$fh>; + + while (/\@/) { + &out($`); + $_ = $'; + + if (/^@/) { + $_ = $'; + &out('@'); + next; + } + + if (/^([\s\n])/) { + $_ = $'; + print "\n" if $1 eq "\n"; + $texmode = 1; + next; + } + + if (/^[cpd]/i) { + $_ = $'; + $texmode = 0; + next; + } + + if (/^\,/i) { + $_ = $'; + print '\,'; + next; + } + + if (m!^/!) { + $_ = $'; + print '\\\\'; + next; + } + + if (/^[h\&\|\;\#\+]/i || /^i.*/i) { + $_ = $'; + next; + } + + if (/^\*[0-9\*]?((.|\n)*?\.)/) { + $_ = $'; + print $1; + $texmode = 1; + next; + } + + if (/^[<(^.t!]((.|\n)*?)\@\>/i) { + $_ = $'; + print '{'.$1.'}'; + $texmode = 0; + next; + } + + if (/^[=]((.|\n)*?)\@\>/) { + $_ = $'; + print &printnl($1); + next; + } + + if (/^[fsl](\s+\S+\s+\S+)|^\'(.|\n)*?\'|^\[((.|\n)*?)\@\]/i) { + $_ = $'; + print &printnl($+); + next; + } + + @line = split(/\n/, $_, 2); + print STDERR "Unknown opcode, ignored. Buffer:\n$line[0]\n"; - if(/^[fsl](\s+\S+\s+\S+)|^\'(.|\n)*?\'|^\[((.|\n)*?)\@\]/i) { - $_ = $'; - print &printnl($+); - next; } - @line = split(/\n/, $_, 2); - print STDERR "Unknown opcode, ignored. Buffer:\n$line[0]\n"; + print $_; } -print $_; - sub printnl { my($foo); - if(defined $_[0]) { - $foo = $_[0]; - $foo =~ s/.//g; + if (defined $_[0]) { + $foo = $_[0]; + $foo =~ s/.//g; } else { - $foo = ""; + $foo = ""; } $foo; } diff --git a/Build/source/texk/chktex/configure b/Build/source/texk/chktex/configure index cdf9b1d88f7..7243f994ba3 100755 --- a/Build/source/texk/chktex/configure +++ b/Build/source/texk/chktex/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ChkTeX (TeX Live) 1.7.4. +# Generated by GNU Autoconf 2.69 for ChkTeX (TeX Live) 1.7.6. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ChkTeX (TeX Live)' PACKAGE_TARNAME='chktex--tex-live-' -PACKAGE_VERSION='1.7.4' -PACKAGE_STRING='ChkTeX (TeX Live) 1.7.4' +PACKAGE_VERSION='1.7.6' +PACKAGE_STRING='ChkTeX (TeX Live) 1.7.6' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1340,7 +1340,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ChkTeX (TeX Live) 1.7.4 to adapt to many kinds of systems. +\`configure' configures ChkTeX (TeX Live) 1.7.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1411,7 +1411,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ChkTeX (TeX Live) 1.7.4:";; + short | recursive ) echo "Configuration of ChkTeX (TeX Live) 1.7.6:";; esac cat <<\_ACEOF @@ -1531,7 +1531,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ChkTeX (TeX Live) configure 1.7.4 +ChkTeX (TeX Live) configure 1.7.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2187,7 +2187,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ChkTeX (TeX Live) $as_me 1.7.4, which was +It was created by ChkTeX (TeX Live) $as_me 1.7.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7872,7 +7872,7 @@ fi # Define the identity of the package. PACKAGE='chktex--tex-live-' - VERSION='1.7.4' + VERSION='1.7.6' cat >>confdefs.h <<_ACEOF @@ -14205,7 +14205,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -ChkTeX (TeX Live) config.lt 1.7.4 +ChkTeX (TeX Live) config.lt 1.7.6 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -15802,7 +15802,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ChkTeX (TeX Live) $as_me 1.7.4, which was +This file was extended by ChkTeX (TeX Live) $as_me 1.7.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15868,7 +15868,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ChkTeX (TeX Live) config.status 1.7.4 +ChkTeX (TeX Live) config.status 1.7.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/chktex/version.ac b/Build/source/texk/chktex/version.ac index 5c215157b08..8379d9ddf7f 100644 --- a/Build/source/texk/chktex/version.ac +++ b/Build/source/texk/chktex/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current chktex version -m4_define([chktex_version], [1.7.4]) +m4_define([chktex_version], [1.7.6]) -- cgit v1.2.3