From 3a541689af28f049f62be1f1b4df97763179f847 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 7 May 2016 18:43:35 +0200
Subject: redefine \abjad in case polyglossia Arabic is loaded

---
 arabluatex.dtx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index 6a94dab..dc7193f 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -2158,8 +2158,14 @@ wa-ya.sIru ta.hta 'l-jildi
 %   \changes{v1.1}{2016/04/26}{New and more flexible \protect\cs{abjad}
 %   command.}
 %    \begin{macrocode}
-\NewDocumentCommand{\abjad}{m}%
+\AtBeginDocument{%
+  \ifdefined\abjad%
+  \RenewDocumentCommand{\abjad}{m}%
+  {\luadirect{tex.sprint(abjadify(#1))}}%
+  \else%
+  \NewDocumentCommand{\abjad}{m}%
   {\luadirect{tex.sprint(abjadify(#1))}}
+\fi}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be
-- 
cgit v1.2.3

