]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucwmac.tex
Nicer warning messages
[ucwmac.git] / ucwmac.tex
index d4b4e3d60c93c448f34053da0dea477ed63a1b0e..61b2103f4f384f4ec99aebb9e58343c90ae08c3f 100644 (file)
 \long\def\prependef#1#2{\expandafter\def\expandafter#1\expandafter{#2#1}}
 \long\def\appendef#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
 
-\def\ucwwarn#1{\immediate\write16{*** Warning: #1 ***}}
+% Variants of \def and \let, where the control sequence name is given as a string
+\def\sdef#1{\expandafter\def\csname#1\endcsname}
+\def\slet#1#2{\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
+
+% Add \protected to an existing macro
+\def\addprotected#1{\protected\edef#1{\expandafter\unexpanded\expandafter{#1}}}
+
+% Protect ~
+\addprotected~
+
+\def\ucwwarn#1{\immediate\write16{*** UCWmac warning: #1 ***}}
 
 %%% Page size and margins %%%
 
 % \putimage{width specification}{file}
 \def\putimage#1#2{\hbox{\pdfximage #1{#2}\pdfrefximage\pdflastximage}}
 
-% Let ~ be protected
-\let\plaintilde=~
-\protected\def~{\plaintilde}
-
 %%% Colors %%%
 
 % Use of pdfTeX color stack: