From 901e64d4e549f603cdc6e8cc642f1a4e5680251a Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Fri, 26 Feb 2016 18:52:27 +0100
Subject: use \luastring(N/O){} so no need to robustify anymore

---
 arabluatex.dtx | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index c0e1163..9c2ac08 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -201,55 +201,57 @@
   will try to load Amiri}%
 \newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}%
 \AtBeginDocument{\ifdef{\LR}%
-  {\renewrobustcmd{\LR}[1]{\bgroup\textdir TLT\rmfamily#1\egroup}}
-  {\newrobustcmd{\LR}[1]{\bgroup\textdir TLT\rmfamily#1\egroup}}}
+  {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}
+  {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}}
 \AtBeginDocument{\ifdef{\RL}%
-  {\renewrobustcmd{\RL}[1]{\bgroup\textdir TRT\rmfamily#1\egroup}}
-  {\newrobustcmd{\RL}[1]{\bgroup\textdir TRT#1\rmfamily\egroup}}}
+  {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}}
+  {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}}
+\AtBeginDocument{\ifdef{\aemph}%
+  {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}
+  {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}}
 \DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir TRT\arabicfont#1\egroup}
 \DeclareDocumentCommand{\arb}{O{\al@mode} +m}%
 {\edef\@tempa{#1}%
     \ifx\@tempa\al@mode@voc%
       \bgroup\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processvoc("\luaescapestring{#2}"))}\egroup%
+      \luadirect{tex.sprint(processvoc(\luastringN{#2}))}\egroup%
     \else%
     \ifx\@tempa\al@mode@fullvoc%
       \bgroup\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processfullvoc("\luaescapestring{#2}"))}\egroup%
+      \luadirect{tex.sprint(processfullvoc(\luastringN{#2}))}\egroup%
     \else%
     \ifx\@tempa\al@mode@novoc%
       \bgroup\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processnovoc("\luaescapestring{#2}"))}\egroup%
+      \luadirect{tex.sprint(processnovoc(\luastringN{#2}))}\egroup%
     \else%
     \fi\fi\fi}
-\DeclareDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}
 \NewEnviron{arab}[1][\al@mode]%
 {\par\edef\@tempa{#1}%
     \ifx\@tempa\al@mode@voc%
       \bgroup\pardir TRT\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processvoc("\luaescapestring{\BODY}"))}\egroup%
+      \luadirect{tex.sprint(processvoc(\luastringO{\BODY}))}\egroup%
     \else%
     \ifx\@tempa\al@mode@fullvoc%
       \bgroup\pardir TRT\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processfullvoc("\luaescapestring{\BODY}"))}\egroup%
+      \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY}))}\egroup%
     \else%
     \ifx\@tempa\al@mode@novoc%
       \bgroup\pardir TRT\textdir TRT\arabicfont%
-      \luadirect{tex.sprint(processnovoc("\luaescapestring{\BODY}"))}\egroup%
+      \luadirect{tex.sprint(processnovoc(\luastringO{\BODY}))}\egroup%
     \else
       \BODY% 
     \fi\fi\fi}[\par]
-\robustify{\textbf}
-\robustify{\emph}
-\robustify{\footnote}
-\robustify{\marginpar}
+% \robustify{\textbf}
+% \robustify{\emph}
+% \robustify{\footnote}
+% \robustify{\marginpar}
 \DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}}
 \RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir
   TLT\arabic{footnote}\egroup}
 \DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir
   TLT\LR{\footnote{#1}}\egroup}
-\AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}}
-\AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}}
+% \AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}}
+% \AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}}
 \endinput
 %    \end{macrocode}
 
-- 
cgit v1.2.3

