On Mon, Mar 12, 2001 at 04:41:29PM +0100, Guenter Milde wrote:
> Actually there are 4 variants of what a user might want :
>
> | command already defined | command not defined | LaTeX command
> -----------------------------------------------------------
> 1 | use my version | use my version | ???
> 2 | use default version | use my version | \providecommand
> 3 | use default version | warn me (i.e. error) | {}
> 4 | warn me (i.e. error) | use my version | \newcommand
>
It should not hard to write a command for case 1 (called \setcommand for
example):
\def\setcommand{\@star@or@long\set@command}
\def\set@command#1{%
\begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup
\let\@ifdefinable\@rc@ifdefinable
\new@command#1}
I just copied the code from \renewcommand and deleted few lines.
Since I'm not a TeX wizard I'm not sure if the above code is entirely correct.