From b316efb7c226ec53ad21c090980220a4dacd15ff Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 3 Oct 2009 15:28:25 +0000
Subject: fixme 4.1 (30sep09)

git-svn-id: svn://tug.org/texlive/trunk@15612 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/fixme/fixme.sty | 57 ++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 22 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/fixme/fixme.sty')

diff --git a/Master/texmf-dist/tex/latex/fixme/fixme.sty b/Master/texmf-dist/tex/latex/fixme/fixme.sty
index 91683fa26bc..b599ed3a753 100644
--- a/Master/texmf-dist/tex/latex/fixme/fixme.sty
+++ b/Master/texmf-dist/tex/latex/fixme/fixme.sty
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fixme}[2009/09/21 v4.0 Insert fixme notes in your documents]
+\ProvidesPackage{fixme}[2009/09/30 v4.1 Insert fixme notes in your documents]
 
 \RequirePackage{ifthen}
 \RequirePackage{verbatim}
@@ -51,6 +51,17 @@
 \newcommand\@fxpkgwarning{\PackageWarning{FiXme}}
 \newcommand\@fxpkgerror{\PackageError{FiXme}}
 
+\newcommand*\@fxaddtolist[2]{%
+  \expandafter\ifx\csname #1\endcsname\relax%
+    \expandafter\def\csname #1\endcsname{#2}%
+  \else%
+    \expandafter\ifx\csname #1\endcsname\empty%
+      \expandafter\g@addto@macro\csname #1\endcsname{#2}%
+    \else%
+      \expandafter\g@addto@macro\csname #1\endcsname{,#2}%
+    \fi%
+  \fi}
+
 \newcommand\@fxkeyifundefined{\key@ifundefined[fx]}
 \newcommand\@fxdefinekey{\define@key[fx]}
 \newcommand*\@fxvoidkeyerror[2]{%
@@ -192,15 +203,28 @@ mu$}\hfill
 \let\@fxearlylayouts\empty
 \let\@fxlatelayouts\empty
 \newcommand*\FXProvidesLayout[1]{\ProvidesPackage{fxlayout#1}}
+\newcommand*\@fxrecordlayoutmutex[2]{%
+  \edef\@fxlts{\zap@space#2 \@empty}%
+  \def\@fxexpr{\@fxaddtolist{@fxlayout@#1@mutex}}%
+  \expandafter\@fxexpr\expandafter{\@fxlts}%
+  \@for\@fxlt:=\@fxlts\do{\@fxaddtolist{@fxlayout@\@fxlt @mutex}{#1}}}
+\newcommand*\@fxhandlelayoutmutex[1]{%
+  \ifthenelse{\boolean{fx@layout@#1}}{%
+    \def\@fxexpr{\@for\@fxlt:=}%
+    \expandafter\@fxexpr\csname @fxlayout@#1@mutex\endcsname\do{%
+      \@ifundefined{iffx@layout@\@fxlt}{}{%
+        \ifthenelse{\boolean{fx@layout@\@fxlt}}{%
+          \@fxpkgwarning{%
+            #1 layout requested;\MessageBreak
+            turning \@fxlt\space layout off}%
+          \@nameuse{fx@layout@\@fxlt}{false}}{}}}}{}}
+
 \def\@FXRegisterLayout#1[#2]#3#4{%
   \@fxkeyifundefined{layout}{#3}{%
-    \@fxdefineboolkey[#2]{layout}{#3}%
+    \@fxrecordlayoutmutex{#3}{#2}%
+    \@fxdefineboolkey[\@fxhandlelayoutmutex{#3}]{layout}{#3}%
     \expandafter\def\csname @fxlayout@#3\endcsname{#4}%
-    \expandafter\ifx\csname @fx#1layouts\endcsname\empty%
-      \expandafter\g@addto@macro\csname @fx#1layouts\endcsname{#3}%
-    \else%
-      \expandafter\g@addto@macro\csname @fx#1layouts\endcsname{,#3}%
-    \fi}{%
+    \@fxaddtolist{@fx#1layouts}{#3}}{%
     \@fxpkgerror{layout '#3' already registered}{%
       You have called \string\FXRegisterLayout\space with a name already
       in use.\MessageBreak
@@ -219,24 +243,12 @@ mu$}\hfill
   \marginpar[%
   \raggedleft\@fxuseface{margin}\ignorespaces#3 \fxnotename{#1}: #2]{%
     \raggedright\@fxuseface{margin}\ignorespaces#3 \fxnotename{#1}: #2}}
-\FXRegisterLayout*[%
-  \ifthenelse{\boolean{fx@layout@margin}\and\boolean{fx@layout@marginclue}}{%
-    \@fxpkgwarning{%
-      marginal notes requested;\MessageBreak
-      turning marginal clues off}%
-    \fx@layout@marginclue{false}}]{%
-    margin}{\FXLayoutMargin}
+\FXRegisterLayout*{margin}{\FXLayoutMargin}
 \newcommand*\FXLayoutMarginClue[3]{%
   \marginpar[%
   \raggedleft\@fxuseface{margin}\ignorespaces#3 \fxnotename{#1}!]{%
     \raggedright\@fxuseface{margin}\ignorespaces#3 \fxnotename{#1}!}}
-\FXRegisterLayout*[%
-  \ifthenelse{\boolean{fx@layout@marginclue}\and\boolean{fx@layout@margin}}{%
-    \@fxpkgwarning{%
-      marginal clues requested;\MessageBreak
-      turning marginal notes off}%
-    \fx@layout@margin{false}}]{%
-    marginclue}{\FXLayoutMarginClue}
+\FXRegisterLayout*[margin]{marginclue}{\FXLayoutMarginClue}
 \newcommand*\FXLayoutFootnote[3]{%
   \footnote{\ignorespaces#3 \fxnotename{#1}: #2}}
 \FXRegisterLayout{footnote}{\FXLayoutFootnote}
@@ -280,6 +292,7 @@ mu$}\hfill
   \edef\@fxlts{\zap@space#1 \@empty}%
   \@for\@fxlt:=\@fxlts\do{\usepackage{fxlayout#1}}}
 
+\newcommand\@fxsetlayoutkeys{\@fxsetkeys{layout}}
 \def\@fxparselayout#1#2#3\relax{\def\@fxltprefix{#1#2}\def\@fxltrest{#3}}
 \newcommand*\fxuselayouts[1]{%
   \edef\@fxlts{\zap@space#1 \@empty}%
@@ -419,7 +432,7 @@ turning margin layout form off}}{%
 \@fxpkginfo{%
   inner mode detected;\MessageBreak
   turning marginclue layout form off}}{}}%
-    \expandafter\fxuselayouts\expandafter{%
+    \expandafter\@fxsetlayoutkeys\expandafter{%
       \cmdfx@layout@innerlayout,nomargin,nomarginclue}%
   \fi}
 \newcommand*\@fxissueearlydraftlayouts[2]{%
-- 
cgit v1.2.3

