texlive[72706] Master/texmf-dist: fvextra (30oct24)

commits+karl at tug.org commits+karl at tug.org
Wed Oct 30 21:01:36 CET 2024


Revision: 72706
          https://tug.org/svn/texlive?view=revision&revision=72706
Author:   karl
Date:     2024-10-30 21:01:36 +0100 (Wed, 30 Oct 2024)
Log Message:
-----------
fvextra (30oct24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fvextra/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/fvextra/fvextra.pdf
    trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
    trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty

Modified: trunk/Master/texmf-dist/doc/latex/fvextra/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fvextra/CHANGELOG.md	2024-10-30 20:00:04 UTC (rev 72705)
+++ trunk/Master/texmf-dist/doc/latex/fvextra/CHANGELOG.md	2024-10-30 20:01:36 UTC (rev 72706)
@@ -1,6 +1,13 @@
 # Changelog
 
 
+## v1.9.0 (2024/10/16)
+
+*  Replaced buffer length counters with macros to prevent issues with
+   `\includeonly` resetting counters.
+
+
+
 ## v1.8.0 (2024/09/14)
 
 *  Added new option `backgroundcolor` (alias `bgcolor`).  This provides a

Modified: trunk/Master/texmf-dist/doc/latex/fvextra/fvextra.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx	2024-10-30 20:00:04 UTC (rev 72705)
+++ trunk/Master/texmf-dist/source/latex/fvextra/fvextra.dtx	2024-10-30 20:01:36 UTC (rev 72706)
@@ -26,7 +26,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{fvextra}
 %<*package>
-    [2024/09/14 v1.8.0 fvextra - extensions and patches for fancyvrb]
+    [2024/10/16 v1.9.0 fvextra - extensions and patches for fancyvrb]
 %</package>
 %
 %<*driver>
@@ -819,7 +819,7 @@
 %
 % Below is an extended example that demonstrates what is possible with |VerbatimBuffer| combined with |\VerbatimInsertBuffer|.  This uses |\ifdefstring| from the \pkg{etoolbox} package.
 % \begin{itemize}
-% \item |\setformatter| defines an empty |\formatter| macro.  Then it loops over the lines in a buffer looking for a line containing only the text ``red''.  If this is found, it redefines |\formatter| to |\color{red}|.  |FancyVerbBufferIndex| is a counter that is always available for buffer looping.  |FancyVerbBufferLength| is the default counter containing the buffer length (number of lines).  |\FancyVerbBufferLineName| contains the base name for buffer line macros (default |FancyVerbBufferLine|).
+% \item |\setformatter| defines an empty |\formatter| macro.  Then it loops over the lines in a buffer looking for a line containing only the text ``red''.  If this is found, it redefines |\formatter| to |\color{red}|.  |FancyVerbBufferIndex| is a counter that is always available for buffer looping.  |\FancyVerbBufferLength| is the default macro containing the buffer length (number of lines).  |\FancyVerbBufferLineName| contains the base name for buffer line macros (default |FancyVerbBufferLine|).
 % \item |afterbuffer| involves two steps:  (1) |\setformatter| loops through the buffer and defines |\formatter| based on the buffer contents, and (2) |\VerbatimInsertBuffer| typesets the buffer, using |formatcom=\formatter| to format the text based on whether any line contains only the text ``red''.
 % \end{itemize}
 %
@@ -827,7 +827,7 @@
 %\def\setformatter{%
 %  \def\formatter{}%
 %  \setcounter{FancyVerbBufferIndex}{1}%
-%  \loop\unless\ifnum\value{FancyVerbBufferIndex}>\value{FancyVerbBufferLength}\relax
+%  \loop\unless\ifnum\value{FancyVerbBufferIndex}>\FancyVerbBufferLength\relax
 %    \expandafter\let\expandafter\bufferline
 %      \csname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname
 %    \ifdefstring{\bufferline}{red}{\def\formatter{\color{red}}}{}%
@@ -846,7 +846,7 @@
 % Here is the same example, but rewritten to use a global buffer with custom buffer names instead.
 %
 %\begin{tcblisting}{oversize=5em}
-%\begin{VerbatimBuffer}[globalbuffer, bufferlinename=exbuff, bufferlengthname=exbuff]
+%\begin{VerbatimBuffer}[globalbuffer, bufferlinename=exbuff, bufferlengthname=exbufflen]
 %first
 %second
 %red
@@ -854,7 +854,7 @@
 %
 %\def\formatter{}
 %\setcounter{FancyVerbBufferIndex}{1}
-%\loop\unless\ifnum\value{FancyVerbBufferIndex}>\value{exbuff}\relax
+%\loop\unless\ifnum\value{FancyVerbBufferIndex}>\exbufflen\relax
 %  \expandafter\let\expandafter\bufferline
 %    \csname exbuff\arabic{FancyVerbBufferIndex}\endcsname
 %  \ifdefstring{\bufferline}{red}{\def\formatter{\color{red}}}{}
@@ -864,7 +864,7 @@
 %\VerbatimInsertBuffer[
 %  formatcom=\formatter,
 %  bufferlinename=exbuff,
-%  bufferlengthname=exbuff
+%  bufferlengthname=exbufflen
 %]
 %\end{tcblisting}
 %
@@ -874,7 +874,7 @@
 %
 % \begin{optionlist}
 % \item[afterbuffer (macro) (\meta{none})]
-% Macro or macros invoked at the end of the environment, after all lines of the environment have been buffered.  This is outside the |\begingroup...\endgroup| that wraps verbatim processing, so \fancyvrb\ settings are no longer active.  However, the buffer line macros and the buffer length counter are still accessible.
+% Macro or macros invoked at the end of the environment, after all lines of the environment have been buffered.  This is outside the |\begingroup...\endgroup| that wraps verbatim processing, so \fancyvrb\ settings are no longer active.  However, the buffer line macros and the buffer length macro are still accessible.
 %
 % \item[bufferer (macro) (\Verb{\FancyVerbDefaultBufferer})]
 % This is the macro that adds lines to the buffer.  The default is designed to create a truly verbatim buffer via |\detokenize|.  This can be customized if you wish to use \fancyvrb\ options related to catcodes to create a buffer that is only partially verbatim (that contains macros).
@@ -890,7 +890,7 @@
 % This macro must be defined globally, so |\xdef| or |\gdef| is necessary (this does not interfere with scoping from |globalbuffer|).  Otherwise, there are no restrictions.  The |\xdef| and |\detokenize| in the default definition guarantee that the buffer consists only of the literal text from the environment, but this is not required for a custom |bufferer|.
 %
 % \item[bufferlengthname (string) (FancyVerbBufferLength)]
-% Name of the counter (|\newcounter|) storing the length of the buffer.  This is the number of lines stored.
+% Name of the macro storing the length of the buffer.  This is the number of lines stored.
 %
 % \item[bufferlinename (string) (FancyVerbBufferLine)]
 % The base name of the buffer line macros.  The default is |FancyVerbBufferLine|, which will result in buffer macros |\FancyVerbBufferLine<n>| with integer |n| greater than or equal to one and less than or equal to the number of lines (one-based indexing).  Since buffer macro names contain a number, they must be accessed differently than typical macros:
@@ -904,11 +904,11 @@
 % Shortcut for setting |bufferlengthname| and |bufferlinename| simultaneously, using the same root name.  This sets |bufferlengthname| to |<buffername>length| and |bufferlinename| to |<buffername>line|.
 %
 % \item[globalbuffer (bool) (false)]
-% This determines whether buffer line macros are defined globally, that is, whether they are accessible after the end of the |VerbatimBuffer| environment.  If the line macros are defined globally, then the buffer length counter is also increased appropriately outside the environment.  |globalbuffer| does not affect any |afterbuffer| macro, since that is invoked inside the environment.
+% This determines whether buffer line macros are defined globally, that is, whether they are accessible after the end of the |VerbatimBuffer| environment.  If the line macros are defined globally, then the buffer length macro is also increased appropriately outside the environment.  |globalbuffer| does not affect any |afterbuffer| macro, since that is invoked inside the environment.
 %
 % When buffered lines are used immediately, consider using |afterbuffer| instead of |globalbuffer|.  When buffered lines must be used later in a document, consider using |globalbuffer| with custom (and perhaps unique) |bufferlinename| and |bufferlengthname|.
 %
-% When |globalbuffer=true|, |VerbatimBuffer| environments with the same buffer name will append to a single buffer, so that it ultimately contains the concatenated contents of all environments.  A |VerbatimBuffer| environment with |globalbuffer=false| will append to the buffer created by any previous |VerbatimBuffer| that had |globalbuffer=true| and shared the same buffer name.  Any |afterbuffer| macro will have access to a buffer containing the concatenated data.  At the very end of the environment with |globalbuffer=false|, after any |afterbuffer|, this appended content will be removed.  All buffer line macros (from |bufferlinename|) that were created by that environment are ``deleted'' (|\let| to an undefined macro), and the buffer length counter (from |bufferlengthname|) is reduced proportionally.
+% When |globalbuffer=true|, |VerbatimBuffer| environments with the same buffer name will append to a single buffer, so that it ultimately contains the concatenated contents of all environments.  A |VerbatimBuffer| environment with |globalbuffer=false| will append to the buffer created by any previous |VerbatimBuffer| that had |globalbuffer=true| and shared the same buffer name.  Any |afterbuffer| macro will have access to a buffer containing the concatenated data.  At the very end of the environment with |globalbuffer=false|, after any |afterbuffer|, this appended content will be removed.  All buffer line macros (from |bufferlinename|) that were created by that environment are ``deleted'' (|\let| to an undefined macro), and the buffer length macro (from |bufferlengthname|) is reduced proportionally.
 % \end{optionlist}
 %
 %
@@ -933,7 +933,7 @@
 % \subsection{\cmd{\VerbatimClearBuffer}}
 % \DescribeMacro{\VerbatimClearBuffer\oarg{options}}
 %
-% Clear an existing buffer created with \cmd{VerbatimBuffer}.  |\global\let| all buffer line macros to an undefined macro and set the buffer length counter to zero.
+% Clear an existing buffer created with \cmd{VerbatimBuffer}.  |\global\let| all buffer line macros to an undefined macro and set the buffer length macro to zero.
 %
 %
 %
@@ -4043,7 +4043,7 @@
 % \end{macro}
 %
 % \begin{macro}{FancyVerbBufferIndex}
-% Current index in buffer during buffering.  This is given a |\FancyVerb*| macro name since it may be accessed by the user in defining custom |bufferer|.
+% Current index in buffer during buffering.  This is given a |FancyVerb*| macro name since it may be accessed by the user in defining custom |bufferer|.
 %    \begin{macrocode}
 \newcounter{FancyVerbBufferIndex}
 %    \end{macrocode}
@@ -4062,14 +4062,16 @@
 % \end{macro}
 %
 % \begin{macro}{bufferlengthname, \FV at bufferlengthname}
-% Name of counter storing the length of the buffer.
+% Name of macro storing the length of the buffer.
 %    \begin{macrocode}
 \define at key{FV}{bufferlengthname}{%
-  \ifcsname c@#1\endcsname
+  \ifcsname#1\endcsname
   \else
-    \newcounter{#1}%
+    \expandafter\xdef\csname#1\endcsname{0}%
   \fi
-  \def\FV at bufferlengthname{#1}}
+  \def\FV at bufferlengthname{#1}%
+  \expandafter\def\expandafter\FV at bufferlengthmacro\expandafter{%
+    \csname#1\endcsname}}
 \fvset{bufferlengthname=FancyVerbBufferLength}
 %    \end{macrocode}
 % \end{macro}
@@ -4092,7 +4094,7 @@
 % \end{macro}
 %
 % \begin{macro}{globalbuffer, FV at globalbuffer}
-% Whether buffer macros and the buffer length counter are defined globally.
+% Whether buffer line macros and the buffer length macro are defined globally.
 %    \begin{macrocode}
 \newbool{FV at globalbuffer}
 \define at booleankey{FV}{globalbuffer}%
@@ -4109,9 +4111,9 @@
 % A special buffer counter is used to track line numbers while avoiding incrementing the regular counter that is used for typeset code.  Some macros do nothing with the default |bufferer|, but are needed to enable \fancyvrb\ options when a custom |bufferer| is used in conjunction with optional environment arguments.  These include |\FancyVerbDefineActive| and |\FancyVerbFormatCom|.  Since counters are global, the exact location of the |\setcounter| commands at the end of the environment relative to |\begingroup...\endgroup| is not important.
 %    \begin{macrocode}
 \newcounter{FancyVerbBufferLine}
-\newcounter{FV at oldbufferlength}
 \newbool{FV at globalbuffer@tmp}
-\let\FV at bufferlengthname@tmp\relax
+\let\FV at oldbufferlength\relax
+\let\FV at bufferlengthmacro@tmp\relax
 \let\FancyVerbBufferLineName at tmp\relax
 \let\FV at afterbuffer@tmp\relax
 \def\VerbatimBuffer{%
@@ -4123,17 +4125,14 @@
   \@bsphack
   \begingroup
   \FV at UseKeyValues
-  \setcounter{FancyVerbBufferLine}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
+  \setcounter{FancyVerbBufferLine}{\FV at bufferlengthmacro}%
   \let\c at FancyVerbLine\c at FancyVerbBufferLine
-  \setcounter{FancyVerbBufferIndex}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
+  \setcounter{FancyVerbBufferIndex}{\FV at bufferlengthmacro}%
   \ifbool{FV at globalbuffer}%
    {\global\booltrue{FV at globalbuffer@tmp}}%
    {\global\boolfalse{FV at globalbuffer@tmp}%
-    \setcounter{FV at oldbufferlength}%
-     {\expandafter\value\expandafter{\FV at bufferlengthname}}%
-    \global\let\FV at bufferlengthname@tmp\FV at bufferlengthname
+    \expandafter\global\expandafter\let\expandafter\FV at oldbufferlength\FV at bufferlengthmacro
+    \global\let\FV at bufferlengthmacro@tmp\FV at bufferlengthmacro
     \global\let\FancyVerbBufferLineName at tmp\FancyVerbBufferLineName}%
   \global\let\FV at afterbuffer@tmp\FV at afterbuffer
   \FV at DefineWhiteSpace
@@ -4144,8 +4143,7 @@
   \FancyVerbFormatCom
   \FV at Scan}
 \def\FVE at VerbatimBuffer{%
-  \expandafter\setcounter\expandafter{\FV at bufferlengthname}%
-   {\value{FancyVerbBufferIndex}}%
+  \expandafter\xdef\FV at bufferlengthmacro{\theFancyVerbBufferIndex}%
   \setcounter{FancyVerbBufferIndex}{0}%
   \endgroup
   \@esphack
@@ -4155,16 +4153,16 @@
   \endgroup
   \ifbool{FV at globalbuffer@tmp}%
    {}%
-   {\loop\unless\ifnum\expandafter\value\expandafter{\FV at bufferlengthname@tmp}=
-        \value{FV at oldbufferlength}\relax
+   {\loop\unless\ifnum\FV at bufferlengthmacro@tmp=\FV at oldbufferlength\relax
       \expandafter\global\expandafter\let\csname
-        \FancyVerbBufferLineName at tmp
-        \expandafter\arabic\expandafter{\FV at bufferlengthname@tmp}%
+        \FancyVerbBufferLineName at tmp\FV at bufferlengthmacro@tmp
         \endcsname\FV at Undefined
-      \expandafter\addtocounter\expandafter{\FV at bufferlengthname@tmp}{-1}%
+      \expandafter\xdef\FV at bufferlengthmacro@tmp{%
+        \the\numexpr\FV at bufferlengthmacro@tmp-1\relax}%
     \repeat
-    \global\let\FV at bufferlengthname@tmp\relax
-    \global\let\FancyVerbBufferLineName at tmp\relax}}
+    \global\let\FV at bufferlengthmacro@tmp\relax
+    \global\let\FancyVerbBufferLineName at tmp\relax}%
+  \global\let\FV at oldbufferlength\relax}
 \def\endVerbatimBuffer{\FVE at VerbatimBuffer}
 %    \end{macrocode}
 % \end{macro}
@@ -4190,9 +4188,9 @@
 \def\FV at Scan@InsertBuffer{%
   \FV at CatCodes
   \xdef\FV at EnvironName{\FV at VerbatimInsertEnvName}%
-  \ifnum\expandafter\value\expandafter{\FV at bufferlengthname}=\z@\relax
+  \ifnum\FV at bufferlengthmacro=\z@\relax
     \PackageError{fvextra}%
-     {Buffer length counter \FV at bufferlengthname\space is invalid or zero}%
+     {Buffer length macro \expandafter\string\FV at bufferlengthmacro\space is invalid or zero}%
      {}%
     \let\FV at GetLine\relax
   \fi
@@ -4200,8 +4198,7 @@
 \def\VerbatimInsertBuffer at def@FV at Line#1{%
   \FVExtraRetokenizeVArg{\def\FV at Line}{}{#1}}
 \def\FancyVerbGetLine at VerbatimInsertBuffer{%
-  \ifnum\value{FancyVerbBufferIndex}>%
-      \expandafter\value\expandafter{\FV at bufferlengthname}\relax
+  \ifnum\value{FancyVerbBufferIndex}>\FV at bufferlengthmacro\relax
     \global\let\FV at EnvironName\relax
     \let\next\relax
   \else
@@ -4255,9 +4252,8 @@
   \begingroup
   \def\FV at KeyValues{#1}%
   \FV at UseKeyValues
-  \setcounter{FancyVerbBufferIndex}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
-  \expandafter\setcounter\expandafter{\FV at bufferlengthname}{0}%
+  \setcounter{FancyVerbBufferIndex}{\FV at bufferlengthmacro}%
+  \expandafter\xdef\FV at bufferlengthmacro{0}%
   \loop\unless\ifnum\value{FancyVerbBufferIndex}<1\relax
     \expandafter\global\expandafter\let
       \csname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname

Modified: trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty	2024-10-30 20:00:04 UTC (rev 72705)
+++ trunk/Master/texmf-dist/tex/latex/fvextra/fvextra.sty	2024-10-30 20:01:36 UTC (rev 72706)
@@ -20,7 +20,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{fvextra}
-    [2024/09/14 v1.8.0 fvextra - extensions and patches for fancyvrb]
+    [2024/10/16 v1.9.0 fvextra - extensions and patches for fancyvrb]
 \RequirePackage{etoolbox}
 \RequirePackage{fancyvrb}
 \RequirePackage{upquote}
@@ -1280,11 +1280,13 @@
     \detokenize{#1}}}
 \fvset{bufferer=\FancyVerbDefaultBufferer}
 \define at key{FV}{bufferlengthname}{%
-  \ifcsname c@#1\endcsname
+  \ifcsname#1\endcsname
   \else
-    \newcounter{#1}%
+    \expandafter\xdef\csname#1\endcsname{0}%
   \fi
-  \def\FV at bufferlengthname{#1}}
+  \def\FV at bufferlengthname{#1}%
+  \expandafter\def\expandafter\FV at bufferlengthmacro\expandafter{%
+    \csname#1\endcsname}}
 \fvset{bufferlengthname=FancyVerbBufferLength}
 \define at key{FV}{bufferlinename}{%
   \def\FancyVerbBufferLineName{#1}}
@@ -1297,9 +1299,9 @@
  {\boolfalse{FV at globalbuffer}}
 \fvset{globalbuffer=false}
 \newcounter{FancyVerbBufferLine}
-\newcounter{FV at oldbufferlength}
 \newbool{FV at globalbuffer@tmp}
-\let\FV at bufferlengthname@tmp\relax
+\let\FV at oldbufferlength\relax
+\let\FV at bufferlengthmacro@tmp\relax
 \let\FancyVerbBufferLineName at tmp\relax
 \let\FV at afterbuffer@tmp\relax
 \def\VerbatimBuffer{%
@@ -1311,17 +1313,14 @@
   \@bsphack
   \begingroup
   \FV at UseKeyValues
-  \setcounter{FancyVerbBufferLine}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
+  \setcounter{FancyVerbBufferLine}{\FV at bufferlengthmacro}%
   \let\c at FancyVerbLine\c at FancyVerbBufferLine
-  \setcounter{FancyVerbBufferIndex}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
+  \setcounter{FancyVerbBufferIndex}{\FV at bufferlengthmacro}%
   \ifbool{FV at globalbuffer}%
    {\global\booltrue{FV at globalbuffer@tmp}}%
    {\global\boolfalse{FV at globalbuffer@tmp}%
-    \setcounter{FV at oldbufferlength}%
-     {\expandafter\value\expandafter{\FV at bufferlengthname}}%
-    \global\let\FV at bufferlengthname@tmp\FV at bufferlengthname
+    \expandafter\global\expandafter\let\expandafter\FV at oldbufferlength\FV at bufferlengthmacro
+    \global\let\FV at bufferlengthmacro@tmp\FV at bufferlengthmacro
     \global\let\FancyVerbBufferLineName at tmp\FancyVerbBufferLineName}%
   \global\let\FV at afterbuffer@tmp\FV at afterbuffer
   \FV at DefineWhiteSpace
@@ -1332,8 +1331,7 @@
   \FancyVerbFormatCom
   \FV at Scan}
 \def\FVE at VerbatimBuffer{%
-  \expandafter\setcounter\expandafter{\FV at bufferlengthname}%
-   {\value{FancyVerbBufferIndex}}%
+  \expandafter\xdef\FV at bufferlengthmacro{\theFancyVerbBufferIndex}%
   \setcounter{FancyVerbBufferIndex}{0}%
   \endgroup
   \@esphack
@@ -1343,16 +1341,16 @@
   \endgroup
   \ifbool{FV at globalbuffer@tmp}%
    {}%
-   {\loop\unless\ifnum\expandafter\value\expandafter{\FV at bufferlengthname@tmp}=
-        \value{FV at oldbufferlength}\relax
+   {\loop\unless\ifnum\FV at bufferlengthmacro@tmp=\FV at oldbufferlength\relax
       \expandafter\global\expandafter\let\csname
-        \FancyVerbBufferLineName at tmp
-        \expandafter\arabic\expandafter{\FV at bufferlengthname@tmp}%
+        \FancyVerbBufferLineName at tmp\FV at bufferlengthmacro@tmp
         \endcsname\FV at Undefined
-      \expandafter\addtocounter\expandafter{\FV at bufferlengthname@tmp}{-1}%
+      \expandafter\xdef\FV at bufferlengthmacro@tmp{%
+        \the\numexpr\FV at bufferlengthmacro@tmp-1\relax}%
     \repeat
-    \global\let\FV at bufferlengthname@tmp\relax
-    \global\let\FancyVerbBufferLineName at tmp\relax}}
+    \global\let\FV at bufferlengthmacro@tmp\relax
+    \global\let\FancyVerbBufferLineName at tmp\relax}%
+  \global\let\FV at oldbufferlength\relax}
 \def\endVerbatimBuffer{\FVE at VerbatimBuffer}
 \define at key{FV}{insertenvname}{%
   \def\FV at VerbatimInsertEnvName{#1}}
@@ -1363,9 +1361,9 @@
 \def\FV at Scan@InsertBuffer{%
   \FV at CatCodes
   \xdef\FV at EnvironName{\FV at VerbatimInsertEnvName}%
-  \ifnum\expandafter\value\expandafter{\FV at bufferlengthname}=\z@\relax
+  \ifnum\FV at bufferlengthmacro=\z@\relax
     \PackageError{fvextra}%
-     {Buffer length counter \FV at bufferlengthname\space is invalid or zero}%
+     {Buffer length macro \expandafter\string\FV at bufferlengthmacro\space is invalid or zero}%
      {}%
     \let\FV at GetLine\relax
   \fi
@@ -1373,8 +1371,7 @@
 \def\VerbatimInsertBuffer at def@FV at Line#1{%
   \FVExtraRetokenizeVArg{\def\FV at Line}{}{#1}}
 \def\FancyVerbGetLine at VerbatimInsertBuffer{%
-  \ifnum\value{FancyVerbBufferIndex}>%
-      \expandafter\value\expandafter{\FV at bufferlengthname}\relax
+  \ifnum\value{FancyVerbBufferIndex}>\FV at bufferlengthmacro\relax
     \global\let\FV at EnvironName\relax
     \let\next\relax
   \else
@@ -1420,9 +1417,8 @@
   \begingroup
   \def\FV at KeyValues{#1}%
   \FV at UseKeyValues
-  \setcounter{FancyVerbBufferIndex}%
-   {\expandafter\value\expandafter{\FV at bufferlengthname}}%
-  \expandafter\setcounter\expandafter{\FV at bufferlengthname}{0}%
+  \setcounter{FancyVerbBufferIndex}{\FV at bufferlengthmacro}%
+  \expandafter\xdef\FV at bufferlengthmacro{0}%
   \loop\unless\ifnum\value{FancyVerbBufferIndex}<1\relax
     \expandafter\global\expandafter\let
       \csname\FancyVerbBufferLineName\arabic{FancyVerbBufferIndex}\endcsname



More information about the tex-live-commits mailing list.