texlive[42335] Master/texmf-dist: listofitems (23oct16)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 24 00:04:26 CEST 2016


Revision: 42335
          http://tug.org/svn/texlive?view=revision&revision=42335
Author:   karl
Date:     2016-10-24 00:04:26 +0200 (Mon, 24 Oct 2016)
Log Message:
-----------
listofitems (23oct16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/listofitems/README
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.pdf
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.tex
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.pdf
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.tex
    trunk/Master/texmf-dist/tex/generic/listofitems/listofitems.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.pdf
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.tex
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.pdf
    trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.tex

Modified: trunk/Master/texmf-dist/doc/generic/listofitems/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/listofitems/README	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/doc/generic/listofitems/README	2016-10-23 22:04:26 UTC (rev 42335)
@@ -4,9 +4,9 @@
              listofitems
                package
                
-                v1.1
+                v1.2
 
-             01/09/2016
+             22/10/2016
 ___________________________________
 
 Authors   : Christian Tellechea, Steven B. Segletes

Modified: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.tex	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-en.tex	2016-10-23 22:04:26 UTC (rev 42335)
@@ -198,6 +198,8 @@
 \def\List{12,abc, x y ,{\bfseries z}, ,\TeX,,!}
 \readlist\foo\List|
 
+The macro \verb|\greadlist| makes \emph{global} assignments and therefore, enables the use of \verb|<macro-list>| outside of the group where \verb|\greadlist| has been executed.
+
 \paragraph{Access an item}
 The macro \verb|\foo| \emph{requires} a numeric argument in square brackets, 
   which we symbolically denote as $i$, indicating the rank of the item 
@@ -482,4 +484,6 @@
 
 \itemtomacro\poem[2,-4]\word
 A word = \word|
+
+The macro \verb|\gitemtomacro| makes a global assignment.
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.tex	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-fr.tex	2016-10-23 22:04:26 UTC (rev 42335)
@@ -146,6 +146,8 @@
 \def\liste{12,abc, x y ,{\bfseries z}, ,\TeX,,!}
 \readlist\foo\liste|
 
+La macro \verb|\greadlist| agit comme \verb|\readlist| mais effectue des assignations \emph{globales} et par conséquent, la \verb|<macroliste>| est utilisable hors du groupe où a été exécutée \verb|\greadlist|.
+
 \paragraph{Accéder à un élément}
 La macro \verb|\foo| attend un argument numérique \emph{obligatoire} entre crochets, que nous notons $i$ et qui désigne le rang de l'élément auquel on souhaite accéder. Ainsi, \verb|\foo[1]| est\footnote{Il faut 2 développements à \texttt{\textbackslash foo[}$i$\texttt] pour obtenir l'élément \no$i$.} \og\verb|12|\fg. De la même façon, \verb|\foo[4]| est \og\verb|{\bfseries z}|\fg. 
 
@@ -349,4 +351,6 @@
 
 \itemtomacro\poeme[2,-4]\mot
 Un mot = \mot|
+
+La macro \verb|\gitemtomacro| fait une assignation globale.
 \end{document}
\ No newline at end of file

Deleted: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.tex	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-latex.tex	2016-10-23 22:04:26 UTC (rev 42335)
@@ -1,129 +0,0 @@
-% Ceci est le fichier de test (pdf)(Xe)(lua)latex de l'entension listofitems
-%
-% Encodage utf8
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Mise en garde : lorsqu'il est compilé, ce fichier DOIT générer des erreurs aux %
-%                 endroits où figure "ERREUR" dans le code source.               %
-%                 Ces erreurs sont émises par l'extension listofitems lorsqu'un  %
-%                 argument ou un index est erroné et qu'une solution est         %
-%                 prévue.                                                        %
-%                 Le fichier pdf ou dvi DOIT être correctement généré.           %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Fichier compilé avec pdflatex
-%
-\documentclass[frenchb]{article}
-\usepackage[T1]{fontenc}
-\usepackage[utf8]{inputenc}
-\usepackage[margin=2cm]{geometry}
-\usepackage{listofitems}
-\usepackage{babel}
-\begin{document}
-\parindent=0pt
-{\hfill\huge\bfseries Fichier de test\hfill\null\par}
-\section{Séparateur vide}
-Séparateur vide :\setsepchar{}% ERREUR : le séparateur "," est pris par défaut
-\readlist\castordu{a aa, b , c cc }
-\showitems\castordu
-
-\section{Liste vide}
-Liste vide :\setsepchar{*}
-\readlist\listevide{}% ERREUR
-Showitems = \showitems\listevide\par% ne donne rien, pas d'erreur
-3\ieme{} élément = \listevide[3]\par% ne donne rien, pas d'erreur
-Longueur = \listevidelen% affiche 0
-
-\section{Cas standard}
-\setsepchar{+}
-Lecture par défaut,\readlist\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Lecture sans élément vide,\ignoreemptyitems
-\readlist\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Lecture sans élément vide ni espace extrêmes,\ignoreemptyitems
-\readlist*\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Longueur = \malistelen\par
-liste entière = \maliste[]\par
-2\ieme{} élément = \maliste[2]\par
--1\ieme{} élément = \maliste[-1]\par
--2\ieme{} élément = \maliste[-2]\par
--7\ieme{} élément = \maliste[-7]\par% ERREUR, doit afficher la liste entière
-7\ieme{} élément = \maliste[7]% ERREUR, doit afficher la liste entière
-
-\section{Séparateur = \char`\\par}
-\def\laliste{a b c \par def\par\par xyz}
-\reademptyitems
-\setsepchar{\par}
-Lecture par défaut, \readlist\maliste\laliste
-showitems = \showitems\maliste
-
-Lecture sans élément vide, \ignoreemptyitems
-\readlist\maliste\laliste
-showitems = \showitems\maliste
-
-\section{Séparateur = caractère actif}
-\begingroup
-\catcode`\!=13 \def!{|}
-\setsepchar{!}
-\readlist\foo{!1 ! 2 !! 3!}
-Showitems = \showitems\foo\par
-liste entière = \foo[]\par
-2\ieme{} élément = \foo[2]\par
--1\ieme{} élément = \foo[-1]\par
--5\ieme{} élément = \foo[-5]\par% ERREUR, doit afficher la liste entière
-\endgroup
-
-\section{Séparateurs = +\quad -\quad *\quad /}
-\setsepchar[.]{+||-||*||/}
-\def\expression{3 + 2*7 - 4*9/5 - 1}
-\readlist*\nombres\expression
-Showitems = \showitems\nombres\par
-liste entière = \nombres[]\par
-Longueur = \nombreslen\par
-2\ieme{} élément = \nombres[2]\par
--1\ieme{} élément = \nombres[-1]\par
--5\ieme{} élément = \nombres[-5]
-
-\section{Séparateurs = \char`\&{} et \char`\\\char `\\}
-\setsepchar{\\/&}
-\readlist\foo{1 & 2 & 3\\ a & b& \\ x & & z}
-Showitems[] = \showitems*\foo\par
-Showitems[2] = \showitems*\foo[2]\par
-Showitems[2,1] = \showitems*\foo[2,1]\par% ERREUR : trop grande profondeur
-Foreachitem = \foreachitem\myitem\in\foo[3]{\myitemcnt = "\myitem"\qquad}\par
-élément [-2,-3] = "\foo[-2,-3]"\par
-
-\section{Séparateurs = \char`\^\char`\^M actif et ponctuations (\char`\;{} et \char`\:{} sont actives)}
-\begingroup
-\obeylines
-\ignoreemptyitems
-\setsepchar{^^M/ ||,||'||-||:||;||.}%
-\readlist\poeme{C'est un trou de verdure où chante une rivière,
-Accrochant follement aux herbes des haillons
-D'argent ; où le soleil, de la montagne fière,
-Luit : c'est un petit val qui mousse de rayons.}% « Le dormeur du val », Arthur Rimbaud
-\begingroup% dans ce groupe
-\renewcommand\showitemsmacro[1]{% aller à la ligne (\par) après chaque élément
-	\begingroup\fboxsep=0.25pt \fboxrule=0.5pt \fbox{\strut#1}\endgroup\par
-}
-Showitems[] =
-\showitems\poeme
-\endgroup% revenir à la macro \showitemsmacro par défaut
-\medbreak
-
-Nombre de vers = \poemelen{} ou \listlen\poeme[]
-Mots du 1\ier{} vers = \showitems\poeme[1]
-Mots du dernier vers = \showitems\poeme[-1]
-4\ieme{} mot du premier vers = "\poeme[1,4]"
-5\ieme{} mot du 3\ieme{} vers = "\poeme[3,5]"
-\medbreak
-
-\textbf{Rimes} :
-\foreachitem\vers\in\poeme{vers \no\verscnt{} : \poeme[\verscnt,-1]\par}
-\endgroup
-\end{document}
\ No newline at end of file

Deleted: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.tex	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/doc/generic/listofitems/listofitems-test-tex.tex	2016-10-23 22:04:26 UTC (rev 42335)
@@ -1,143 +0,0 @@
-% Ceci est le fichier de test (pdf)(Xe)(lua)tex de l'entension listofitems
-%
-% Encodage ISO-8859-1
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Mise en garde : lorsqu'il est compil\xE9, ce fichier DOIT g\xE9n\xE9rer des erreurs aux %
-%                 endroits o\xF9 figure "ERREUR" dans le code source.               %
-%                 Ces erreurs sont \xE9mises par l'extension listofitems lorsqu'un  %
-%                 argument ou un index est erron\xE9 et qu'une solution est         %
-%                 pr\xE9vue.                                                        %
-%                 Le fichier pdf ou dvi DOIT \xEAtre correctement g\xE9n\xE9r\xE9.           %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Fichier compil\xE9 avec pdftex
-%
-\hsize = \dimexpr 21cm - 2in \relax
-\vsize = \dimexpr 29.7cm - 2in \relax
-
-\input listofitems.tex
-
-\newcount\sectioncnt
-\def\section#1{\advance \sectioncnt1 \bigbreak{\loisectionfont \the\sectioncnt\quad #1}\smallbreak}
-\def\expo#1{\penalty10000 \raise0.66667ex \hbox{\loiexpofont#1}}
-\font\loititlefont=ecbx2000 % titre
-\font\loisectionfont=ecbx1400 % section
-\font\loiexpofont=ecrm1000 at 8pt % exposant
-\font\loitextfont=ecrm1000 % texte
-\font\loitextfontbf=ecbx1000 % gras
-
-\catcode`\;=13 \def;{\unskip\penalty10000 \ \string;}% caract\xE8res actifs de ponctuation fran\xE7aise
-\catcode`\:=13 \def:{\unskip\penalty10000 \ \string:}
-
-%%%%% D\xC9BUT DU DOCUMENT
-\loitextfont
-\parindent=0pt
-\centerline{\loititlefont Fichier de test (pdftex et etex)}
-\par\vskip1.5cm
-
-\section{S\xE9parateur vide}
-Separateur vide :\setsepchar{}% ERREUR : le s\xE9parateur "," est pris par d\xE9faut
-\readlist\castordu{a aa, b , c cc }
-\showitems\castordu
-
-\section{Liste vide}
-Liste vide :\setsepchar{*}
-\readlist\listevide{}% ERREUR
-Showitems = \showitems\listevide\par% ne donne rien, pas d'erreur
-3\expo{e} \xE9l\xE9ment = \listevide[3]\par% ne donne rien, pas d'erreur
-Longueur = \listevidelen% affiche 0
-
-\section{Cas standard}
-\setsepchar{+}
-Lecture par d\xE9faut,\readlist\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Lecture sans \xE9l\xE9ment vide,\ignoreemptyitems
-\readlist\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Lecture sans \xE9l\xE9ment vide ni espace extr\xEAmes,\ignoreemptyitems
-\readlist*\maliste{123+ 456 + ++\par+{+}+* *}
-showitems = \showitems*\maliste
-
-Longueur = \malistelen\par
-liste enti\xE8re = \maliste[]\par
-2\expo{e} \xE9l\xE9ment = \maliste[2]\par
--1\expo{e} \xE9l\xE9ment = \maliste[-1]\par
--2\expo{e} \xE9l\xE9ment = \maliste[-2]\par
--7\expo{e} \xE9l\xE9ment = \maliste[-7]\par% ERREUR, doit afficher la liste enti\xE8re
-7\expo{e} \xE9l\xE9ment = \maliste[7]% ERREUR, doit afficher la liste enti\xE8re
-
-\section{S\xE9parateur = \char`\\par}
-\def\laliste{a b c \par def\par\par xyz}
-\reademptyitems
-\setsepchar{\par}
-Lecture par d\xE9faut, \readlist\maliste\laliste
-showitems = \showitems\maliste
-
-Lecture sans \xE9l\xE9ment vide, \ignoreemptyitems
-\readlist\maliste\laliste
-showitems = \showitems\maliste
-
-\section{S\xE9parateur = caract\xE8re actif}
-\begingroup
-\catcode`\!=13 \def!{|}
-\setsepchar{!}
-\readlist\foo{!1 ! 2 !! 3!}
-Showitems = \showitems\foo\par
-liste enti\xE8re = \foo[]\par
-2\expo{e} \xE9l\xE9ment = \foo[2]\par
--1\expo{er} \xE9l\xE9ment = \foo[-1]\par
--5\expo{e} \xE9l\xE9ment = \foo[-5]\par% ERREUR, doit afficher la liste enti\xE8re
-\endgroup
-
-\section{S\xE9parateurs = +\quad -\quad *\quad /}
-\setsepchar[.]{+||-||*||/}
-\def\expression{3 + 2*7 - 4*9/5 - 1}
-\readlist*\nombres\expression
-Showitems = \showitems\nombres\par
-liste enti\xE8re = \nombres[]\par
-Longueur = \nombreslen\par
-2\expo{e} \xE9l\xE9ment = \nombres[2]\par
--1\expo{e} \xE9l\xE9ment = \nombres[-1]\par
--5\expo{e} \xE9l\xE9ment = \nombres[-5]
-
-\section{S\xE9parateurs = \char`\&{} et \char`\\\char `\\}
-\setsepchar{\\/&}
-\readlist\foo{1 & 2 & 3\\ a & b& \\ x & & z}
-Showitems[] = \showitems*\foo\par
-Showitems[2] = \showitems*\foo[2]\par
-Showitems[2,1] = \showitems*\foo[2,1]\par% ERREUR : trop grande profondeur
-Foreachitem = \foreachitem\myitem\in\foo[3]{\myitemcnt = "\myitem"\qquad}\par
-\xE9l\xE9ment [-2,-3] = "\foo[-2,-3]"\par
-
-\section{S\xE9parateurs = \char`\^\char`\^M actif et ponctuations (\char`\;{} et \char`\:{} sont actives)}
-\begingroup
-\obeylines
-\ignoreemptyitems
-\setsepchar{^^M/ ||,||'||-||:||;||.}%
-\readlist\poeme{C'est un trou de verdure o\xF9 chante une rivi\xE8re,
-Accrochant follement aux herbes des haillons
-D'argent ; o\xF9 le soleil, de la montagne fi\xE8re,
-Luit : c'est un petit val qui mousse de rayons.}% « Le dormeur du val », Arthur Rimbaud
-\begingroup% dans ce groupe
-\def\showitemsmacro#1{% aller \xE0 la ligne (\par) apr\xE8s chaque \xE9l\xE9ment
-	\begingroup\fboxsep=0.25pt \fboxrule=0.5pt \fbox{\strut#1}\endgroup\par
-}
-Showitems[] =
-\showitems\poeme
-\endgroup% revenir \xE0 la macro \showitemsmacro par d\xE9faut
-\medbreak
-
-Nombre de vers = \poemelen{} ou \listlen\poeme[]
-Mots du 1er vers = \showitems\poeme[1]
-Mots du dernier vers = \showitems\poeme[-1]
-4\expo{e} mot du premier vers = "\poeme[1,4]"
-5\expo{e} mot du 3e vers = "\poeme[3,5]"
-\medbreak
-
-{\loitextfontbf Rimes} :
-\foreachitem\vers\in\poeme{vers n\expo{\unkern o}\verscnt{} : \poeme[\verscnt,-1]\par}
-\endgroup
-\bye
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/generic/listofitems/listofitems.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/listofitems/listofitems.tex	2016-10-23 22:01:39 UTC (rev 42334)
+++ trunk/Master/texmf-dist/tex/generic/listofitems/listofitems.tex	2016-10-23 22:04:26 UTC (rev 42335)
@@ -3,9 +3,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                    %
 \def\loiname                 {listofitems}                           %
-\def\loiver                      {1.1}                               %
+\def\loiver                      {1.2}                               %
 %                                                                    %
-\def\loidate                  {2016/9/01}                            %
+\def\loidate                  {2016/10/22}                           %
 %                                                                    %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
@@ -27,12 +27,10 @@
 %        Commentaires, suggestions et signalement de bugs bienvenus !
 %        Comments, bug reports and suggestions are welcome.
 % --------------------------------------------------------------------
-% L'extension listofitems est compos\'ee des 11 fichiers suivants :
+% L'extension listofitems est compos\'ee des 7 fichiers suivants :
 %   - code               : listofitems            (.tex et .sty)
 %   - manuel en francais : listofitems-fr         (.tex et .pdf)
 %   - manuel en anglais  : listofitems-en         (.tex et .pdf)
-%   - test (tex)         : listofitems-test-tex   (.tex et .pdf)
-%   - test (latex)       : listofitems-test-latex (.tex et .pdf)
 %   - fichier lisezmoi   : README
 % --------------------------------------------------------------------
 \expandafter\edef\csname loi_restorecatcode\endcsname{\catcode\number`\_=\number\catcode`\_\relax}
@@ -52,8 +50,10 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begingroup
 \edef\__tempa{\meaning\eTeXversion}\edef\__tempb{\string\eTeXversion}%
-\ifx\__tempa\__tempb\endgroup
-\else\endgroup
+\ifx\__tempa\__tempb
+	\endgroup
+\else
+	\endgroup
 	\loi_error{You are not using an eTeX engine, listofitems cannot work.}%
 	\expandafter\loi_restorecatcode\expandafter\endinput
 \fi
@@ -89,8 +89,10 @@
 			\loi_second% si espace en 1er, faux
 			{\loi_exparg\loi_ifempty{\loi_gobarg#1}% 1 seul token ?
 				{\begingroup \escapechar`\_
-					\if\expandafter\loi_firsttonil\string#1\_nil\expandafter\loi_firsttonil\string\relax\_nil\endgroup\expandafter\loi_first
-					\else\endgroup\expandafter\loi_second
+					\if\expandafter\loi_firsttonil\string#1\_nil\expandafter\loi_firsttonil\string\relax\_nil
+						\endgroup\expandafter\loi_first
+					\else
+						\endgroup\expandafter\loi_second
 					\fi
 				}
 				\loi_second% si plusieurs tokens, faux
@@ -110,7 +112,7 @@
 
 %--- macros retirant les espaces extr\^emes
 %      Voir codes 320 \`a 324 ici --> http://progtex.fr/wp-content/uploads/2014/09/code.txt
-%      et pages 339 \`a 343 de "Appredre \`a programmer en TeX"
+%      et pages 339 \`a 343 de "Apprendre \`a programmer en TeX"
 \long\def\loi_ifspacefirst#1{\expandafter\loi_ifspacefirst_i\detokenize{#10} \_nil}
 \long\def\loi_ifspacefirst_i#1 #2\_nil{\loi_ifempty{#1}}
 \expandafter\def\expandafter\loi_gobspace\space{}
@@ -143,6 +145,7 @@
 		\def\nestdepth{1}%
 		\loi_argcsname\let{loi_previndex[\number\loi_nestcnt]}\empty
 		\def\loi_listname{loi_listofsep}%
+		\let\loi_def\def \let\loi_edef\edef \let\loi_let\let
 		\loi_ifempty{#2}
 			{\loi_error{Empty list of separators not allowed, "," used}%
 			\readlist_iv1{,}%
@@ -182,8 +185,14 @@
 %%%%%%%%%%%%%%%%%%%%%% macro publique \readlist %%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \newcount\loi_nestcnt
-
+\def\greadlist{%
+	\let\loi_def\gdef \let\loi_edef\xdef \def\loi_let{\global\let}%
+	\loi_nestcnt1 % niveau initial = 1
+	\loi_argcsname\let{loi_previndex[\number\loi_nestcnt]}\empty
+	\loi_ifstar{\_removeextremespacestrue\readlist_i}{\_removeextremespacesfalse\readlist_i}%
+}
 \def\readlist{%
+	\let\loi_def\def \let\loi_edef\edef \let\loi_let\let
 	\loi_nestcnt1 % niveau initial = 1
 	\loi_argcsname\let{loi_previndex[\number\loi_nestcnt]}\empty
 	\loi_ifstar{\_removeextremespacestrue\readlist_i}{\_removeextremespacesfalse\readlist_i}%
@@ -196,14 +205,14 @@
 		\loi_argcsname\def{\loi_listname[]}{#2}% la liste enti\`ere
 		\loi_argcsname\def{\loi_listname sep[]}{}% s\'eparateur vide
 		\loi_ifempty{#2}
-			{\def#1[##1]{}%
-			\loi_argcsname\def{\loi_listname len}{0}\loi_argcsname\def{\loi_listname len[0]}{0}%
+			{\loi_def#1[##1]{}%
+			\loi_argcsname\def{\loi_listname len}{0}\loi_argcsname\loi_def{\loi_listname len[0]}{0}%
 			\loi_error{Empty list ignored, nothing to do}%
 			}
-			{\edef#1[##1]{\unexpanded{\romannumeral\expandafter\loi_auxmacrolistitem\romannumeral\loi_normalizeindex}{\loi_listname}{##1}{\csname\loi_listname nest\endcsname}{\loi_listname}}%
-			\loi_argcsname\edef{\loi_listname sep}[##1]{\unexpanded{\romannumeral\expandafter\loi_auxmacrolistitem\romannumeral\loi_normalizeindex}{\loi_listname}{##1}{\csname\loi_listname nest\endcsname}{\loi_listname sep}}%
+			{\loi_edef#1[##1]{\unexpanded{\romannumeral\expandafter\loi_auxmacrolistitem\romannumeral\loi_normalizeindex}{\loi_listname}{##1}{\csname\loi_listname nest\endcsname}{\loi_listname}}%
+			\loi_argcsname\loi_edef{\loi_listname sep}[##1]{\unexpanded{\romannumeral\expandafter\loi_auxmacrolistitem\romannumeral\loi_normalizeindex}{\loi_listname}{##1}{\csname\loi_listname nest\endcsname}{\loi_listname sep}}%
 			\readlist_ii{#2}%
-			\loi_argcsname\loi_argcsname\let{\loi_listname len}{\loi_listname len[0]}% longueur du niveau 0
+			\loi_argcsname\loi_argcsname\loi_let{\loi_listname len}{\loi_listname len[0]}% longueur du niveau 0
 			}%
 		}%
 }
@@ -218,9 +227,9 @@
 \long\def\readlist_iii#1||#2\_nil#3{\readlist_iv1{#3#1}}% #1=<sep courant simple>  #3=liste -> rajoute un \'el\'ement vide pour le test ifempty ci dessous
 \long\def\readlist_iv#1#2{% #1=compteur d'index  #2=liste d'\'el\'ements \`a examiner
 	\loi_ifempty{#2}
-		{\loi_argcsname\edef{\loi_listname len[\csname loi_previndex[\number\loi_nestcnt]\endcsname0]}{\number\numexpr#1-1\relax}%
+		{\loi_argcsname\loi_edef{\loi_listname len[\csname loi_previndex[\number\loi_nestcnt]\endcsname0]}{\number\numexpr#1-1\relax}%
 		\advance\loi_nestcnt-1
-		\loi_argcsname\let\loi_currentsep{loi_listofsep[\number\loi_nestcnt]}%
+		\loi_argcsname\loi_let\loi_currentsep{loi_listofsep[\number\loi_nestcnt]}%
 		}
 		{\loi_expafternil\readlist_vi{#2}{}\_nil\loi_currentsep||\loi_quark||#2\_nil{#1}}% aller isoler le 1er item
 }
@@ -250,8 +259,8 @@
 \long\def\readlist_x#1#2#3#4{% #1=compteur d'index  #2=liste restante  #3=\'el\'ement courant   #4=sep utilis\'e
 	\loi_ifnum{0\if_ignoreemptyitems1\fi\loi_ifempty{#3}1{}=11 }
 		{\readlist_iv{#1}{#2}}% si l'on n'ignore pas les \'el\'ements vides :
-		{\loi_argcsname\def{\loi_listname[\csname loi_previndex[\number\loi_nestcnt]\endcsname#1]}{#3}% assignation de l'item ctuel \`a la macro
-		\loi_argcsname\def{\loi_listname sep[\csname loi_previndex[\number\loi_nestcnt]\endcsname#1]}{#4}% assignation du <sep> actuel \`a la macro \<macrolist>sep
+		{\loi_argcsname\loi_def{\loi_listname[\csname loi_previndex[\number\loi_nestcnt]\endcsname#1]}{#3}% assignation de l'item ctuel \`a la macro
+		\loi_argcsname\loi_def{\loi_listname sep[\csname loi_previndex[\number\loi_nestcnt]\endcsname#1]}{#4}% assignation du <sep> actuel \`a la macro \<macrolist>sep
 		\loi_ifnum{\loi_nestcnt<\nestdepth\relax}% si imbrication max non atteinte
 			{\advance\loi_nestcnt1
 			\loi_argcsname\edef{loi_previndex[\number\loi_nestcnt]}{\csname loi_previndex[\number\numexpr\loi_nestcnt-1]\endcsname#1,}%
@@ -327,11 +336,15 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \def\itemtomacro#1[#2]{% #1[#2]=item  non encore lu: #3=macro
 	\edef\loi_listname{\loi_macroname#1}%
-	\loi_exparg{\expandafter\itemtomacro_i\romannumeral\expandafter\loi_normalizeindex\expandafter{\loi_listname}{#2}}{\csname\loi_listname nest\endcsname}%
+	\loi_exparg{\expandafter\itemtomacro_i\romannumeral\expandafter\loi_normalizeindex\expandafter{\loi_listname}{#2}}{\csname\loi_listname nest\endcsname}\let
 }
-\def\itemtomacro_i#1#2#3{%
+\def\gitemtomacro#1[#2]{% #1[#2]=item
+	\xdef\loi_listname{\loi_macroname#1}%
+	\loi_exparg{\expandafter\itemtomacro_i\romannumeral\expandafter\loi_normalizeindex\expandafter{\loi_listname}{#2}}{\csname\loi_listname nest\endcsname}{\global\let}%
+}
+\def\itemtomacro_i#1#2#3#4{%
 	\loi_ifempty{#1}{}{\loi_error{#1}}%
-	\loi_argcsname\let#3{\loi_listname[#2]}%
+	\loi_argcsname#3#4{\loi_listname[#2]}%
 }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -352,8 +365,11 @@
 ######################################################################
 
 v1.0  19/8/2016
-    - Premi\`ere version publique
+      - Premi\`ere version publique
 
 v1.1  01/09/2016
-    - Stockage des s\'eparateurs dans <macrolist>sep
-    - bug corrig\'e dans \loi_restorecatcode
\ No newline at end of file
+      - Stockage des s\'eparateurs dans <macrolist>sep
+      - bug corrig\'e dans \loi_restorecatcode
+
+v1.2  22/10/2016
+      - macros \greadlist et \gitemtomacro pour la globalit\'e
\ No newline at end of file



More information about the tex-live-commits mailing list