texlive[60081] Master/texmf-dist: macrolist (26jul21)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 26 22:30:56 CEST 2021


Revision: 60081
          http://tug.org/svn/texlive?view=revision&revision=60081
Author:   karl
Date:     2021-07-26 22:30:56 +0200 (Mon, 26 Jul 2021)
Log Message:
-----------
macrolist (26jul21)

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

Modified: trunk/Master/texmf-dist/doc/latex/macrolist/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/macrolist/README.md	2021-07-26 20:30:41 UTC (rev 60080)
+++ trunk/Master/texmf-dist/doc/latex/macrolist/README.md	2021-07-26 20:30:56 UTC (rev 60081)
@@ -1,4 +1,4 @@
-# The LaTeX package macrolist - version 1.2.0 (2021/07/23)
+# The LaTeX package macrolist - version 1.2.1 (2021/07/25)
 
 > Copyright (C) 2021 Dennis Chen <proofprogram at gmail.com>
 >

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

Modified: trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx	2021-07-26 20:30:41 UTC (rev 60080)
+++ trunk/Master/texmf-dist/source/latex/macrolist/macrolist.dtx	2021-07-26 20:30:56 UTC (rev 60081)
@@ -16,7 +16,7 @@
 %<*package>
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/23 v1.2.0 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them]
 
 \RequirePackage{pgffor}
 %</package>
@@ -94,6 +94,7 @@
     \csname macrolist at list@#1\the\numexpr #2\relax\endcsname%
 }
 % \fi
+% \changes{v1.2.1}{2021/07/25}{Fix behavior of listindexof and listcontains for empty lists}
 % \changes{v1.2.0}{2021/07/23}{Add listindexof and listcontains}
 % \DescribeMacro{\listindexof}
 %
@@ -106,12 +107,14 @@
 \newcommand{\listindexof}[2]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \def\macrolist at el{#2}%
-    \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
-        \ifx\macrolist at el\macrolist at listindexel
-            \xdef\macrolist at listindex{\macrolist at index}%
-        \fi
-    }%
+    \ifnum\listsize{#1}>0\relax
+        \def\macrolist at el{#2}%
+        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+            \ifx\macrolist at el\macrolist at listindexel
+                \xdef\macrolist at listindex{\macrolist at index}%
+            \fi
+        }%
+    \fi
     \macrolist at listindex%
     \let\macrolist at listindex\relax%
 }
@@ -125,12 +128,14 @@
 \newcommand{\listcontains}[4]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \def\macrolist at el{#2}%
-    \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
-        \ifx\macrolist at el\macrolist at listindexel
-            \xdef\macrolist at listindex{\macrolist at index}%
-        \fi
-    }%
+    \ifnum\listsize{#1}>0\relax
+        \def\macrolist at el{#2}%
+        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+            \ifx\macrolist at el\macrolist at listindexel
+                \xdef\macrolist at listindex{\macrolist at index}%
+            \fi
+        }%
+    \fi
     \ifnum\macrolist at listindex>0\relax
         #3%
     \else

Modified: trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty	2021-07-26 20:30:41 UTC (rev 60080)
+++ trunk/Master/texmf-dist/tex/latex/macrolist/macrolist.sty	2021-07-26 20:30:56 UTC (rev 60081)
@@ -15,7 +15,7 @@
 %% version 2005/12/01 or later.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/23 v1.2.0 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them]
 
 \RequirePackage{pgffor}
 
@@ -35,12 +35,14 @@
 \newcommand{\listindexof}[2]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \def\macrolist at el{#2}%
-    \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
-        \ifx\macrolist at el\macrolist at listindexel
-            \xdef\macrolist at listindex{\macrolist at index}%
-        \fi
-    }%
+    \ifnum\listsize{#1}>0\relax
+        \def\macrolist at el{#2}%
+        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+            \ifx\macrolist at el\macrolist at listindexel
+                \xdef\macrolist at listindex{\macrolist at index}%
+            \fi
+        }%
+    \fi
     \macrolist at listindex%
     \let\macrolist at listindex\relax%
 }
@@ -47,12 +49,14 @@
 \newcommand{\listcontains}[4]{%
     \def\macrolist at listindex{0}%
     \macrolist at exists{#1}%
-    \def\macrolist at el{#2}%
-    \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
-        \ifx\macrolist at el\macrolist at listindexel
-            \xdef\macrolist at listindex{\macrolist at index}%
-        \fi
-    }%
+    \ifnum\listsize{#1}>0\relax
+        \def\macrolist at el{#2}%
+        \listforeach{#1}{\macrolist at listindexel}[\listsize{#1}][1]{%
+            \ifx\macrolist at el\macrolist at listindexel
+                \xdef\macrolist at listindex{\macrolist at index}%
+            \fi
+        }%
+    \fi
     \ifnum\macrolist at listindex>0\relax
         #3%
     \else



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