diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-19 00:41:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-19 00:41:57 +0000 |
commit | 8ace832e879e91b82b2d380cfc322ce9b74b88f2 (patch) | |
tree | ec7e9f6ff8254345257bbdcf57f52aa25437978f /Master/texmf-dist/tex | |
parent | bae5d4e052265783b372a10316a6d6e820a6b3dd (diff) |
ltxnew 1.2 (18apr10)
git-svn-id: svn://tug.org/texlive/trunk@17908 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxnew/ltxnew.sty | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxnew/ltxnew.sty b/Master/texmf-dist/tex/latex/ltxnew/ltxnew.sty index e93290b61e1..f56eb46c8f4 100644 --- a/Master/texmf-dist/tex/latex/ltxnew/ltxnew.sty +++ b/Master/texmf-dist/tex/latex/ltxnew/ltxnew.sty @@ -21,13 +21,13 @@ %% ltxnew.sty, ltxnew.pdf, ltxnew.ins, %% %% ltxnew : provides the \new \renew and \provide prefixes for checking definitions -%% Copyright (C) 2009 by Florent Chervet <florent.chervet@free.fr> +%% Copyright (C) 2009-2010 by Florent Chervet <florent.chervet@free.fr> %% \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [2005/12/01]% LaTeX must be 2005/12/01 or younger (see kvsetkeys.dtx). \ProvidesPackage{ltxnew} - [2009/10/11 v1.1 provides the new and renew prefixes for checking definitions] + [2010/04/17 v1.2 provides the new and renew prefixes for checking definitions] \RequirePackage{etex} @@ -127,7 +127,9 @@ \def\ltxn@expand@prefix{% \expandafter\futurelet\expandafter\x\expandafter\ltxn@@prefix} \def\ltxn@addto@prfx#1{\let\y\@undefined - \edef\ltxn@prfx{\ltxn@expandonce{\ltxn@prfx}\ltxn@expandonce{\z}}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\ltxn@prfx + \expandafter\expandafter\expandafter{\expandafter\ltxn@prfx\z}% \ltxn@next@addto} \expandafter\def\expandafter\ltxn@space@prefix\space{\ltxn@next@prefix} \def\ltxn@error@prefix{\@latex@error{A \string\def\space @@ -145,17 +147,18 @@ % new: Do define or cancel, depending on the result of \@ifdefinable \def\ltxn@new#1{% \let\next\ltxn@cancel - \ifdefined#1\unless\ifx#1\relax\def#1{ltxn@throw@error}\fi\fi + \ifdefined#1\unless\ifx#1\relax\def#1{new:error}\fi\fi \expandafter\@ifdefinable\noexpand#1{% \expandafter\let\noexpand#1=\relax - \edef\next{\endgroup\ltxn@expandonce{\ltxn@prfx}\noexpand#1}}% + \edef\next{\endgroup\ltxn@expandonce\ltxn@prfx#1}}% \next} + % renew: Throws an error in case the control sequence is unknown or \relax \def\ltxn@renew#1{% - \edef\ltxn@name{\string#1 }% - \ifdefined#1 \ifx#1\relax \ltxn@error{renew: \ltxn@name undefined}\fi - \else \ltxn@error{renew: \ltxn@name undefined}% + \edef\ltxn@name{\string#1}% + \ifdefined#1\ifx#1\relax\ltxn@error{renew: \ltxn@name undefined}\fi + \else \ltxn@error{renew: \ltxn@name undefined}% \fi \let#1=\relax \def\next{\ltxn@new#1}% @@ -165,7 +168,7 @@ \def\ltxn@provide#1{% \let\next\ltxn@cancel \edef\ltxn@name{\string#1}% - \ifdefined#1 \ifx#1\relax \ltxn@provide@new\fi + \ifdefined#1\ifx#1\relax \ltxn@provide@new\fi \else \ltxn@provide@new \fi \next} @@ -174,15 +177,15 @@ % \new: the entry point: % just let the definition macro to be \ltxn@new and start scanning prefixes. -\def\new{\let\ltxn@def\ltxn@new\ltxn@prefix} +\protected\def\new{\let\ltxn@def\ltxn@new\ltxn@prefix} % \renew: the entry point: % just let the definition macro to be \ltxn@renew and start scanning prefixes. -\def\renew{\let\ltxn@def\ltxn@renew\ltxn@prefix} +\protected\def\renew{\let\ltxn@def\ltxn@renew\ltxn@prefix} % \provide: the entry point: % just let the definition macro to be |\ltxn@provide| and start scanning prefixes. -\def\provide{\let\ltxn@def\ltxn@provide\ltxn@prefix} +\protected\def\provide{\let\ltxn@def\ltxn@provide\ltxn@prefix} % In case of redefinition, throws an |\ehc|-type error: \def\ltxn@error#1{\@latex@error{#1}\@ehc} |