>From 48dcad932a43762eab4f5f7b8d7845428136d612 Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Wed, 29 Aug 2018 20:43:57 +0900 Subject: [PATCH 1/9] fcvextract.pl: Use 'linelabel' env in extracted snippet For consistency with commit 6bf7a51b7b9d ("Add 'linelabel' and 'lineref' environment"), enclose "VerbatimL" env in "linelabel" env in extracted code snippet. Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- utilities/fcvextract.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/utilities/fcvextract.pl b/utilities/fcvextract.pl index 8c6025a..cba96e7 100755 --- a/utilities/fcvextract.pl +++ b/utilities/fcvextract.pl @@ -42,7 +42,7 @@ # Verbatim environment of fancyvrb package): # # --- -# \renewcommand{\lnlblbase}{ln:toolsoftrade:api-pthreads:waitall} +# \begin{linelabel}[ln:toolsoftrade:api-pthreads:waitall] # \begin{VerbatimL}[commandchars=\%\[\]] # int pid; # int status; @@ -57,6 +57,7 @@ # } # }%lnlbl[loopb] # \end{VerbatimL} +# \end{linelabel} # --- # # <snippet identifier> corresponds to a meta command embedded in @@ -78,12 +79,12 @@ # This script converts the \lnlbl{} commands with these charcters # reverse-converted. # -# To make the actual labels to have the full form of: +# To make the actual labels to have the full form of # # "ln:<chapter>:<file name>:<function>:<line label>" # -# in LaTeX processing, this script will generate a \renewcommand{} -# command as shown above. The macro is used within \lnlbl{} command. +# in LaTeX processing, this script will enclose the snippet with +# a pair of \begin{linelabel} and \end{linelabel} as shown above. # # To omit a line in extracted snippet, put "\fcvexclude" in comment # on the line. @@ -142,7 +143,7 @@ while($line = <>) { print "% Do not edit!\n" ; print "% Generated by utilities/fcvextract.pl.\n" ; if ($line =~ /labelbase=([^,]+)/) { - print "\\renewcommand\{\\lnlblbase\}\{$1\}\n" ; + print "\\begin\{linelabel}\[$1\]\n" ; } print "\\begin\{VerbatimL\}" ; if ($line =~ /commandchars=([^,]+).*\]$/) { @@ -161,7 +162,7 @@ while($line = <>) { } } if ($extracting == 2) { - print "\\end\{VerbatimL\}\n" ; + print "\\end\{VerbatimL\}\n\\end\{linelabel\}\n" ; exit 0; } else { exit 1; -- 2.7.4