summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicefilelist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-21 23:54:16 +0000
committerKarl Berry <karl@freefriends.org>2012-05-21 23:54:16 +0000
commit83ea821e5153a6e36b35e799efb3ef833dd316a4 (patch)
tree09b27fe507ba1190281b6918f9f4adfc62c536ce /Master/texmf-dist/tex/latex/nicefilelist
parentf6a6e91fb663b813a417b4de2377cb578d56f646 (diff)
nicefilelist 0.4 (21may12)
git-svn-id: svn://tug.org/texlive/trunk@26551 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicefilelist')
-rw-r--r--Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.RLS5
-rw-r--r--Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty138
2 files changed, 86 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.RLS b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.RLS
new file mode 100644
index 00000000000..7fa50e33682
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.RLS
@@ -0,0 +1,5 @@
+\ProvidesFile{nicefilelist.RLS} %% RELEASE INFO
+ [{2012/05/20 r0.4 v0.4 Kabelschacht + [r] }]
+% [2012/05/20 v0.3 Kabelschacht reimplementation]
+% [2012/03/29 v0.2 reimpl.: much within \string\typeout]
+% [2012/03/23 v0.1(a) initial]
diff --git a/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty
index 9b28578966e..4cf70735873 100644
--- a/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty
+++ b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{nicefilelist}[2012/03/29 v0.2
+\ProvidesPackage{nicefilelist}[2012/05/20 v0.4
more file list alignment (UL)]
%% Copyright (C) 2012 Uwe Lueck,
@@ -75,6 +75,26 @@
%% (text in \cs{Provides.\empty..} arguments) will never contain such a
%% ``funny `Q'".
%%
+%% === Package Option `[r]' ===
+%% \label{sec:opt}
+%% v0.4 offers package option `[r]' that allows strings with `r'
+%% in place of `v', for ``release." `\NFL@v@digit''s definition
+%% therefore depends ... we use |\@listfiles| for a ``message"
+%% there. For the original restricted functionality, it expands
+%% to |\NFL@false|.
+\def\@listfiles{\noexpand\NFL@false}
+%% Package option `[r]' carries out another test instead.
+%% See the accompanying file `SrcFILEs.txt' to see the effect.
+%% TODO: update example!?
+\DeclareOption{r}{%
+ \def\@listfiles{%
+ {\noexpand\NFL@ifx@kbl##1r%
+ {\noexpand\NFL@digits##2\noexpand\@nnil}%
+ \noexpand\NFL@false}%
+ }%
+}
+\ProcessOptions
+%%
%% === Redefining \cs{listfiles} ===
%% Similarly to original \LaTeX, |\listfiles| carries almost everything
%% that is needed for the file list only:
@@ -82,9 +102,10 @@
\let\listfiles\relax
%% ---this clears memory. Now \LaTeX\ doesn't collect file names for
%% &\listfiles when &\@listfiles is undefined, therefore
- \let\@listfiles\relax
-%% although we don't use it.
-%% (TODO use it in place of some `\NFL@'...?)
+% \let\@listfiles\relax
+%% % although we don't use it.
+%% % (TODO use it in place of some `\NFL@'...?)
+%% ... postponed for v0.4 ...
%% \vskip\smallskipamount\noindent
%% |\@dofilelist| is executed by the standard \LaTeX\ `\enddocument'
%% macro or by `\ListInfos' from the \ctanpkgref{myfilist} package.
@@ -111,14 +132,11 @@
\NFL@make@macro@arg\MFrightinfield\@tempa {f-base}.%
\NFL@make@macro@arg\MFleftinfield \filename@ext{f-ext}%
\NFLspaceI
- \ifx\@tempb\relax
- \NFLnotfound
- \else
+ \NFL@ifx@kbl\@tempb\relax\NFLnotfound{%
\NFL@make@macro@arg\NFL@space@split\@tempb
\NFL@maybe@three
\NFL@date@or@rest
-%% TODO `\expandafter's?
- \fi
+ }%
}%
}%
%% The line of stars:
@@ -136,17 +154,28 @@
%% passes prefix and suffix as arguments to <spaced>
%% if a space token is within <token-list>, otherwise
%% <unspaced> gets the original <token-list> as single
-%% argument:\footnote{The latter is useful here where <token-list>
-%% becomes visible only by an &\expandafter.}
+%% argument. The latter is useful here where <token-list>
+%% becomes visible only by an &\expandafter.
+%% The following construction is discussed more generally
+%% in the \ctanpkgref{bitelist} package.
\def\NFL@space@split##1{%
\NFL@return@space@split##1\@nil: \NFL@criterion\@nil\@nil@{##1}}%
+%% `\NFL@return@spaces@split' essentially has \emph{three} parameters
+%% delimited by ` ', `\@nil', and `\@nil' again.
\def\NFL@return@space@split##1 ##2\@nil##3\@nil@##4##5##6{%
- \ifx\NFL@criterion##2\expandafter\@secondoftwo
-%% If #2 is empty, \cs{ifx} fails, comparing &\NFL@criterion with
-%% &\expandafter. This only happens when the space is the last thing
-%% in <token-list>. %% 2012/03/27
- \else \expandafter\@firstoftwo \fi
- {##5{##1}{##2}}{##6{##4}}}%
+ \NFL@ifx@kbl\NFL@criterion{##2}%
+%% If #2 is empty, `\NFL@ifx@kbl' (as of v0.3) compares
+%% `\NFL@criterion' (criterion indicating ``unspaced") with
+%% `\expandafter'. This only happens when the space is the last thing
+%% in <token-list>, and `<spaced>' is chosen correctly.
+ {##6{##4}}{##5{##1}{##2}}}%
+%% |\NFL@ifx@kbl{<token>}{<maybe-token>}{<ifx>}{<unlessx>}|
+%% as of v0.3 should save some tokens, in some longer run,
+%% especially if we want to add nestings---cf. \file{source2e.pdf}
+%% for ``Kabelschacht."
+ \def\NFL@ifx@kbl##1##2{%
+ \ifx##1##2\expandafter \@firstoftwo
+ \else \expandafter \@secondoftwo \fi}%
%% Dealing with |\NFL@date@or@rest{<token-list>}| before `\NFL@maybe@three':
\def\NFL@date@or@rest##1{%
\NFL@if@date{##1}{##1}{\NFL@no@date@version##1}}%
@@ -154,50 +183,32 @@
\def\NFL@if@date##1{\NFL@slashes##1\NFL@xi xyzxyzxyzx\@nil}%
%% |\NFL@slashes| checks that there are slashes at the expected places:
\def\NFL@slashes##1##2##3##4##5##6##7##8{%
- \ifx##5/%
- \ifx##8/%
- \NFL@xpxpxp \NFL@ten@only
- \else
- \expandafter\NFL@after@false
- \fi
- \else
- \NFL@after@false
+ \NFL@ifx@kbl##5/%
+ {\NFL@ifx@kbl##8/\NFL@ten@only\NFL@false}%
+ \NFL@false
%% This especially happens when <token-list> is empty.
- \fi
%% Digit candidates back:
{##1##2##3##4##6##7}}%
- \def\NFL@xpxpxp{\expandafter\expandafter\expandafter}%
%% If the word is a date, we now have taken 6 of the 8 digits.
%% \[|\NFL@ten@only{<digits>}<digit><digit>Q|\]
%% takes the two remaining and then a thing that should be `Q'
%% in the funny sense of Sec.~\ref{sec:safe}.
\def\NFL@ten@only##1##2##3##4{%
- \ifx\NFL@xi##4%
- \expandafter\NFL@digits
- \else
- \NFL@after@false
- \fi
+ \NFL@ifx@kbl\NFL@xi##4\NFL@digits\NFL@false
%% Finally checking digits:
##1##2##3\@nnil}%
%% |\NFL@digits<token>| is a loop through single tokens:
\def\NFL@digits##1{%
- \ifx##1\@nnil
- \expandafter \NFL@true
- \else
- \ifnum`##1<`0
- \expandafter \NFL@after@false
- \else
- \ifnum`##1>`9
- \NFL@xpxpxp \NFL@after@false
- \else
- \expandafter\NFL@xpxpxp\expandafter \NFL@digits
- \fi
- \fi
- \fi
+ \NFL@ifx@kbl##1\@nnil\NFL@true{%
+ \NFL@if@digit@code##1<0\NFL@false{%
+ \NFL@if@digit@code##1>9\NFL@false\NFL@digits
+ }%
+ }%
}%
-%% |\NFL@after@false| calls `\NFL@false' \emph{after} closing one
-%% conditional:
- \def\NFL@after@false{\expandafter\NFL@false}%
+%% |\NFL@if@digit@code<char-1><relation><char-2><fits><bad>|:
+ \def\NFL@if@digit@code##1##2##3{%
+ \ifnum`##1##2`##3 \expandafter \@firstoftwo
+ \else \expandafter \@secondoftwo \fi}%
%% |\NFL@false| skips further candidates and dummies and chooses <no>:
\def\NFL@false##1\@nil{\@secondoftwo}%
%% |\NFL@true| skips further candidates and dummies and chooses <yes>:
@@ -206,7 +217,7 @@
%% |\NFL@no@date@version| as soon as we find that the file info
%% does not start with a date:
\def\NFL@no@date@version{%
- \NFLnodate\NFLspaceII\NFLnoversion@\NFLspaceIII}
+ \NFLnodate\NFLspaceII\NFLnoversion@\NFLspaceIII}%
%% |\NFLnoversion@| adds filler to &\NFLnoversion:
\def\NFLnoversion@{%
\NFL@make@macro@arg\NFL@place@version\NFLnoversion}%
@@ -233,14 +244,16 @@
%% present way.
%% \vskip\smallskipamount\noindent
%% |\NFL@v@digit{<t1>}{<t2>}{<rest>}| checks whether the first thing
-%% is a `v' and the second a digit:
- \def\NFL@v@digit##1##2##3\@nil{%
- \ifx##1v%
- \expandafter \NFL@digits \expandafter ##2\expandafter \@nnil
- \else
- \NFL@after@false
- \fi
- \@nil}%
+%% is a `v' and the second a digit---unless package option `[r]'
+%% was chosen. v0.4 uses `\edef' for choosing:
+ \edef\NFL@v@digit##1##2##3\@nil{%
+ \noexpand\NFL@ifx@kbl##1v%
+ {\noexpand\NFL@digits##2\noexpand\@nnil}%
+%% |\@listfiles| will either expand to the original `\NFL@false'
+%% or to a test on `r':
+ \@listfiles
+ \noexpand\@nil}%
+ \let\@listfiles\relax
%% |\NFL@place@version{<token-list>}| adds filler to version id:
\def\NFL@place@version##1{\MFleftinfield{##1}{f-version}}%
%% |\NFL@maybe@version@rest{<list-1>}{<list-2>}|:
@@ -266,3 +279,14 @@ v0.2 2012/03/24 file info processed by \typeout - start
2012/03/27 undone the latter, explained; improved remarks on
\@listfiles
2012/03/29 alignment of title/stars with base<11
+
+v0.30 2012/05/18f. \NFL@ifx@kbl in \NFL@return@space@split
+ 2012/05/20 all \ifx reimplemented, old code kept
+ STORED INTERNALLY
+v0.31 2012/05/20 removing old code - STORED INTERNALLY
+v0.32 2012/05/20 removing \NFL@xpxpxp; replacing \NFL@after@false
+ by \NFL@ifnum@kbl, keeping old code
+ STORED INTERNALLY
+v0.33 2012/05/20 removing old code; added 3 %s
+ STORED INTERNALLY
+v0.4 2012/05/20 option [r]