From f6ffe013073fe77b745e9b378e1b10e1635ecf43 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 1 Mar 2020 16:58:28 +0100
Subject: done replacing 'options' with 'expkv-def'. fixed misplaced postrefnum
 hook.

---
 ekdosis.dtx | 48 ++++++++++++++++++------------------------------
 1 file changed, 18 insertions(+), 30 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 7e44af5..c6622be 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -348,7 +348,6 @@ Running "make install" installs the files in the local TeX tree.
 \ProcessOptionsX\relax
 \RequirePackage{luacode}
 \RequirePackage{paracol}
-\RequirePackage{options}
 \RequirePackage{expkv-def}
 \RequirePackage{xparse}
 \RequirePackage{etoolbox}
@@ -659,10 +658,10 @@ Running "make install" installs the files in the local TeX tree.
         =
         \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}
         \else
-        \getrefnumber{#1}\unexpanded\expandafter{\ekd@postrefnum}%
+        \getrefnumber{#1}%
         \fi%
       }%
-      {\getrefnumber{#1}\unexpanded\expandafter{\ekd@postrefnum}}%
+      {\getrefnumber{#1}}%
       \else
       \ifsubsq@unit%
       %
@@ -671,24 +670,24 @@ Running "make install" installs the files in the local TeX tree.
       =
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}
       \else
-      \getrefnumber{#1}\unexpanded\expandafter{\ekd@postrefnum}%
+      \getrefnumber{#1}%
       \fi
       %
       \else
-      \getrefnumber{#1}\unexpanded\expandafter{\ekd@postrefnum}%
+      \getrefnumber{#1}%
       \fi
       \fi
       %
       \else
       \getrefnumber{#1}--%
-      \getrefnumber{#2}\unexpanded\expandafter{\ekd@postrefnum}%
+      \getrefnumber{#2}%
       \fi%
       \else
       \getrefnumber{#1}--%
       \getpagerefnumber{#2}.%
-      \getrefnumber{#2}\unexpanded\expandafter{\ekd@postrefnum}%
+      \getrefnumber{#2}%
       \fi%
-    }%
+    }\unexpanded\expandafter{\ekd@postrefnum}%
   }%
 \def\current@ref{{\textdir TLT\unexpanded\expandafter{\ekd@refnumstyle}%
     \ifnum%
@@ -708,10 +707,8 @@ Running "make install" installs the files in the local TeX tree.
         \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}
         \else
         \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}%
-          \unexpanded\expandafter{\ekd@postrefnum}%
         \fi%
-      }{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}%
-          \unexpanded\expandafter{\ekd@postrefnum}}%
+      }{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}%
       \else
       \ifsubsq@unit%
       %
@@ -721,27 +718,23 @@ Running "make install" installs the files in the local TeX tree.
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}
       \else
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}%
-        \unexpanded\expandafter{\ekd@postrefnum}%
       \fi
       %
       \else
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}%
-        \unexpanded\expandafter{\ekd@postrefnum}%
       \fi
       \fi
       %
       \else
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--%
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}%
-        \unexpanded\expandafter{\ekd@postrefnum}%
       \fi%
       \else
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--%
       \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}.%
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}%
-        \unexpanded\expandafter{\ekd@postrefnum}%
       \fi%
-    }%
+    }\unexpanded\expandafter{\ekd@postrefnum}%
   }%
 \define@cmdkeys[ekd]{lemrdg}[ekdlr@]{wit, alt, pre, post, prewit,
   postwit}
@@ -992,21 +985,18 @@ Running "make install" installs the files in the local TeX tree.
   \egroup%
   \subsq@unittrue%
 }
-\options{
-  /note/.new family,
-  /note/pre/.new value = {},
-  /note/post/.new value = {}
+\ekvdefinekeys{note}{
+  store pre = \pre@value,
+  store post = \post@value
 }
 \NewDocumentCommand{\ekd@note}{O{} m}{%
   \bgroup%
-  \options{/note,#1}%
-  \letoption{/note/pre}\pre@value%
-  \letoption{/note/post}\post@value%
+  \ekvset{note}{#1}%
   \edef\note@contents{%
-    \ifoptionvoid{/note/pre}{}{%
+    \ekvifdefinedNoVal{note}{pre}{}{%
       \unexpanded\expandafter{\pre@value}}%
     \unexpanded{#2}%
-    \ifoptionvoid{/note/post}{}{%
+    \ekvifdefinedNoVal{note}{post}{}{%
       \unexpanded\expandafter{\post@value}}%
   }%
   \append@app{\note@contents}%
@@ -1015,14 +1005,12 @@ Running "make install" installs the files in the local TeX tree.
 \NewDocumentCommand{\ekd@note@star}{O{} m}{%
   \if@pkg@parnotes
     \bgroup%
-      \options{/note,#1}%
-      \letoption{/note/pre}\pre@value%
-      \letoption{/note/post}\post@value%
+      \ekvset{note}{#1}%
       \edef\note@contents{%
-        \ifoptionvoid{/note/pre}{}{%
+        \ekvifdefinedNoVal{note}{pre}{}{%
           \unexpanded\expandafter{\pre@value}}%
         \unskip\noexpand\parnote{#2}%
-        \ifoptionvoid{/note/post}{}{%
+        \ekvifdefinedNoVal{note}{post}{}{%
           \unexpanded\expandafter{\post@value}}%
       }%
       \append@app{\note@contents}%
-- 
cgit v1.2.3

