summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-02-19 01:23:44 +0000
committerKarl Berry <karl@freefriends.org>2009-02-19 01:23:44 +0000
commit5b6f93171d7172ec05d3db7011cd737f9897ca44 (patch)
tree6d5953a2ac4f60d50dd5479762795db8c75c462d /Master
parent7e7a92f942d6f82e15d160d4787dfcdc46cd2b86 (diff)
context-letter update, really (18feb09)
git-svn-id: svn://tug.org/texlive/trunk@12183 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/tex/context/interface/third/t-letter.xml131
-rw-r--r--Master/texmf-dist/tex/context/third/letter/base/t-correspondence.tex254
-rw-r--r--Master/texmf-dist/tex/context/third/letter/interface/default.nli85
3 files changed, 283 insertions, 187 deletions
diff --git a/Master/texmf-dist/tex/context/interface/third/t-letter.xml b/Master/texmf-dist/tex/context/interface/third/t-letter.xml
index 7992e7ad07a..c8302c7fe8b 100644
--- a/Master/texmf-dist/tex/context/interface/third/t-letter.xml
+++ b/Master/texmf-dist/tex/context/interface/third/t-letter.xml
@@ -3,6 +3,11 @@
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.08.02">
<cd:define name="lettersection">
+ <cd:constant type="letterhead"/>
+ <cd:constant type="dateline"/>
+ <cd:constant type="referenceline"/>
+ <cd:constant type="specialnotation"/>
+ <cd:constant type="insideaddress"/>
<cd:constant type="title"/>
<cd:constant type="subject"/>
<cd:constant type="opening"/>
@@ -12,18 +17,25 @@
</cd:define>
<cd:define name="letterlayer">
- <cd:constant type="letternext"/>
- <cd:constant type="lettermain"/>
<cd:constant type="head"/>
<cd:constant type="foot"/>
+ <cd:constant type="nexthead"/>
+ <cd:constant type="nextfoot"/>
+ <cd:constant type="lefthead"/>
+ <cd:constant type="leftfoot"/>
+ <cd:constant type="righthead"/>
+ <cd:constant type="rightfoot"/>
<cd:constant type="address"/>
<cd:constant type="backaddress"/>
<cd:constant type="reference"/>
+ <cd:constant type="location"/>
<cd:constant type="topmark"/>
<cd:constant type="botmark"/>
<cd:constant type="cutmark"/>
<cd:constant type="endmark"/>
<cd:constant type="usermark"/>
+ <cd:constant type="letternext"/>
+ <cd:constant type="lettermain"/>
</cd:define>
<cd:command name="setupletterstyle:layout" file="t-letter.tex">
@@ -42,11 +54,11 @@
</cd:command>
<cd:command name="setupletterstyle:option" file="t-letter.tex">
- <cd:sequence>
+ <cd:sequence >
<cd:string value="setupletterstyle"/>
</cd:sequence>
<cd:arguments>
- <cd:keywords>
+ <cd:keywords optional="yes">
<cd:constant type="option"/>
</cd:keywords>
<cd:assignments list="yes">
@@ -100,30 +112,7 @@
</cd:arguments>
</cd:command>
-<cd:command name="setupletterstyle:text" file="t-letter.tex">
- <cd:sequence>
- <cd:string value="setupletterstyle"/>
- </cd:sequence>
- <cd:arguments>
- <cd:keywords list="yes">
- <cd:constant type="header"/>
- <cd:constant type="footer"/>
- </cd:keywords>
- <cd:assignments list="yes">
- <cd:parameter name="lefttext">
- <cd:constant type="cd:text"/>
- </cd:parameter>
- <cd:parameter name="middletext">
- <cd:constant type="cd:text"/>
- </cd:parameter>
- <cd:parameter name="righttext">
- <cd:constant type="cd:text"/>
- </cd:parameter>
- </cd:assignments>
- </cd:arguments>
-</cd:command>
-
-<cd:command name="setupletterstyle:section" file="t-letter.tex">
+<cd:command name="setuplettersection" file="t-letter.tex">
<cd:sequence>
<cd:string value="setupletterstyle"/>
</cd:sequence>
@@ -147,11 +136,30 @@
<cd:parameter name="color">
<cd:constant type="cd:name"/>
</cd:parameter>
+ <cd:parameter name="leftmargin">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="rightmargin">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="alternative">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="separator">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="command">
+ <cd:constant type="cd:oneargument"/>
+ </cd:parameter>
+ <cd:parameter name="optimize">
+ <cd:constant type="yes"/>
+ <cd:constant type="no" default="yes"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
-<cd:command name="setupletterstyle:frame" file="t-letter.tex">
+<cd:command name="setupletterlayer:layer" file="t-letter.tex">
<cd:sequence>
<cd:string value="setupletterstyle"/>
</cd:sequence>
@@ -159,7 +167,24 @@
<cd:keywords list="yes">
<cd:resolve name="letterlayer"/>
</cd:keywords>
- <cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant type="layer"/>
+ </cd:keywords>
+ <cd:assignments list="yes">
+ <cd:inherit name="setuplayer"/>
+ </cd:assignments>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="setupletterlayer:frame" file="t-letter.tex">
+ <cd:sequence>
+ <cd:string value="setupletterstyle"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords list="yes">
+ <cd:resolve name="letterlayer"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
<cd:constant type="frame"/>
</cd:keywords>
<cd:assignments list="yes">
@@ -168,7 +193,7 @@
</cd:arguments>
</cd:command>
-<cd:command name="setupletterstyle:layer" file="t-letter.tex">
+<cd:command name="setupletterlayer:option" file="t-letter.tex">
<cd:sequence>
<cd:string value="setupletterstyle"/>
</cd:sequence>
@@ -176,11 +201,49 @@
<cd:keywords list="yes">
<cd:resolve name="letterlayer"/>
</cd:keywords>
- <cd:keywords>
- <cd:constant type="layer"/>
+ <cd:keywords optional="yes">
+ <cd:constant type="option"/>
</cd:keywords>
<cd:assignments list="yes">
- <cd:inherit name="setuplayer"/>
+ <cd:parameter name="state">
+ <cd:constant type="start" default="yes"/>
+ <cd:constant type="stop"/>
+ <cd:constant type="first"/>
+ <cd:constant type="next"/>
+ <cd:constant type="left"/>
+ <cd:constant type="right"/>
+ <cd:constant type="leftpage"/>
+ <cd:constant type="rightpage"/>
+ <cd:constant type="page"/>
+ <cd:constant type="subpage" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="symbol">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="style">
+ <cd:resolve name="style"/>
+ </cd:parameter>
+ <cd:parameter name="color">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="alternative">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="separator">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="leftmargin">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="rightmargin">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="spacebefore">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="spaceafter">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
diff --git a/Master/texmf-dist/tex/context/third/letter/base/t-correspondence.tex b/Master/texmf-dist/tex/context/third/letter/base/t-correspondence.tex
index 61cbb35508c..01694a9875b 100644
--- a/Master/texmf-dist/tex/context/third/letter/base/t-correspondence.tex
+++ b/Master/texmf-dist/tex/context/third/letter/base/t-correspondence.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-correspondence,
-%D version=2008.02.13,
+%D version=2008.02.17,
%D title=\CONTEXT\ User Module,
%D subtitle=Correspondence,
%D author=Wolfgang Schuster,
@@ -54,6 +54,7 @@
\setinterfaceconstant {toaddress} {toaddress}
\setinterfaceconstant {enclosure} {enclosure}
\setinterfaceconstant {copy} {copy}
+ \setinterfaceconstant {ps} {ps}
\setinterfaceconstant {postscript} {postscript}
\setinterfaceconstant {attention} {attention}
\setinterfaceconstant {distribution} {distribution}
@@ -73,6 +74,7 @@
\setinterfaceconstant {subject} {subject}
\setinterfaceconstant {cc} {cc}
\setinterfaceconstant {enclosure} {enclosure}
+ \setinterfaceconstant {encl} {encl}
\setinterfaceconstant {phone} {phone}
\setinterfaceconstant {fax} {fax}
\setinterfaceconstant {email} {email}
@@ -85,93 +87,94 @@
\stopinterface
\startinterface all
- \setinterfacevariable {secondpage} {secondpage}
- \setinterfacevariable {foot} {foot}
- \setinterfacevariable {topmark} {topmark}
- \setinterfacevariable {botmark} {botmark}
- \setinterfacevariable {cutmark} {cutmark}
- \setinterfacevariable {endmark} {endmark}
- \setinterfacevariable {option} {option}
- \setinterfacevariable {foldmark} {foldmark}
- \setinterfacevariable {usermark} {usermark}
- \setinterfacevariable {layer} {layer}
- \setinterfacevariable {firsthead} {firsthead}
- \setinterfacevariable {nexthead} {nexthead}
- \setinterfacevariable {lefthead} {lefthead}
- \setinterfacevariable {righthead} {righthead}
- \setinterfacevariable {firstfoot} {firstfoot}
- \setinterfacevariable {nextfoot} {nextfoot}
- \setinterfacevariable {leftfoot} {leftfoot}
- \setinterfacevariable {rightfoot} {rightfoot}
- \setinterfacevariable {layout} {layout}
- \setinterfacevariable {place} {place}
- \setinterfacevariable {initialize} {initialize}
- \setinterfacevariable {finish} {finish}
- \setinterfacevariable {sequence} {sequence}
- \setinterfacevariable {style} {style}
- \setinterfacevariable {extension} {extension}
- \setinterfacevariable {interface} {interface}
- \setinterfacevariable {resume} {resume}
- \setinterfacevariable {letter} {letter}
- \setinterfacevariable {backaddress} {backaddress}
- \setinterfacevariable {reference} {reference}
- \setinterfacevariable {location} {location}
- \setinterfacevariable {address} {address}
- \setinterfacevariable {opening} {opening}
- \setinterfacevariable {closing} {closing}
- \setinterfacevariable {letternext} {letternext}
- \setinterfacevariable {lettermain} {lettermain}
- \setinterfacevariable {special} {special}
- \setinterfacevariable {notation} {notation}
- \setinterfacevariable {inside} {inside}
- \setinterfacevariable {optimize} {optimize}
- \setinterfacevariable {file} {file}
- \setinterfacevariable {e} {e}
- \setinterfacevariable {data} {data}
- \setinterfacevariable {sender} {sender}
- \setinterfacevariable {dispatch} {dispatch}
- \setinterfacevariable {enclosure} {enclosure}
- \setinterfacevariable {copy} {copy}
- \setinterfacevariable {nobreak} {nobreak}
- \setinterfacevariable {endgraf} {endgraf}
- \setinterfacevariable {memo} {memo}
- \setinterfacevariable {addressee} {addressee}
- \setinterfacevariable {french} {french}
- \setinterfacevariable {simplified} {simplified}
- \setinterfacevariable {fullblock} {fullblock}
- \setinterfacevariable {hanging} {hanging}
- \setinterfacevariable {modified} {modified}
- \setinterfacevariable {semiblock} {semiblock}
- \setinterfacevariable {handle} {handle}
- \setinterfacevariable {casual} {casual}
- \setinterfacevariable {classic} {classic}
- \setinterfacevariable {knuth} {knuth}
- \setinterfacevariable {firstname} {firstname}
- \setinterfacevariable {familyname} {familyname}
- \setinterfacevariable {street} {street}
- \setinterfacevariable {town} {town}
- \setinterfacevariable {mobile} {mobile}
- \setinterfacevariable {phone} {phone}
- \setinterfacevariable {fax} {fax}
- \setinterfacevariable {email} {email}
- \setinterfacevariable {info} {info}
+ \setinterfacevariable {secondpage} {secondpage}
+ \setinterfacevariable {foot} {foot}
+ \setinterfacevariable {topmark} {topmark}
+ \setinterfacevariable {botmark} {botmark}
+ \setinterfacevariable {cutmark} {cutmark}
+ \setinterfacevariable {endmark} {endmark}
+ \setinterfacevariable {option} {option}
+ \setinterfacevariable {foldmark} {foldmark}
+ \setinterfacevariable {usermark} {usermark}
+ \setinterfacevariable {layer} {layer}
+ \setinterfacevariable {firsthead} {firsthead}
+ \setinterfacevariable {nexthead} {nexthead}
+ \setinterfacevariable {lefthead} {lefthead}
+ \setinterfacevariable {righthead} {righthead}
+ \setinterfacevariable {firstfoot} {firstfoot}
+ \setinterfacevariable {nextfoot} {nextfoot}
+ \setinterfacevariable {leftfoot} {leftfoot}
+ \setinterfacevariable {rightfoot} {rightfoot}
+ \setinterfacevariable {layout} {layout}
+ \setinterfacevariable {place} {place}
+ \setinterfacevariable {initialize} {initialize}
+ \setinterfacevariable {finish} {finish}
+ \setinterfacevariable {sequence} {sequence}
+ \setinterfacevariable {style} {style}
+ \setinterfacevariable {extension} {extension}
+ \setinterfacevariable {interface} {interface}
+ \setinterfacevariable {resume} {resume}
+ \setinterfacevariable {letter} {letter}
+ \setinterfacevariable {backaddress} {backaddress}
+ \setinterfacevariable {reference} {reference}
+ \setinterfacevariable {location} {location}
+ \setinterfacevariable {address} {address}
+ \setinterfacevariable {opening} {opening}
+ \setinterfacevariable {closing} {closing}
+ \setinterfacevariable {letternext} {letternext}
+ \setinterfacevariable {lettermain} {lettermain}
+ \setinterfacevariable {special} {special}
+ \setinterfacevariable {notation} {notation}
+ \setinterfacevariable {inside} {inside}
+ \setinterfacevariable {optimize} {optimize}
+ \setinterfacevariable {file} {file}
+ \setinterfacevariable {e} {e}
+ \setinterfacevariable {data} {data}
+ \setinterfacevariable {sender} {sender}
+ \setinterfacevariable {dispatch} {dispatch}
+ \setinterfacevariable {enclosure} {enclosure}
+ \setinterfacevariable {copy} {copy}
+ \setinterfacevariable {nobreak} {nobreak}
+ \setinterfacevariable {endgraf} {endgraf}
+ \setinterfacevariable {memo} {memo}
+ \setinterfacevariable {addressee} {addressee}
+ \setinterfacevariable {french} {french}
+ \setinterfacevariable {simplified} {simplified}
+ \setinterfacevariable {fullblock} {fullblock}
+ \setinterfacevariable {hanging} {hanging}
+ \setinterfacevariable {modified} {modified}
+ \setinterfacevariable {semiblock} {semiblock}
+ \setinterfacevariable {handle} {handle}
+ \setinterfacevariable {casual} {casual}
+ \setinterfacevariable {classic} {classic}
+ \setinterfacevariable {knuth} {knuth}
+ \setinterfacevariable {firstname} {firstname}
+ \setinterfacevariable {familyname} {familyname}
+ \setinterfacevariable {street} {street}
+ \setinterfacevariable {town} {town}
+ \setinterfacevariable {mobile} {mobile}
+ \setinterfacevariable {phone} {phone}
+ \setinterfacevariable {fax} {fax}
+ \setinterfacevariable {email} {email}
+ \setinterfacevariable {info} {info}
+ \setinterfacevariable {correspondence} {correspondence}
\stopinterface
\startinterface all
- \setinterfaceelement {set} {set}
- \setinterfaceelement {value} {value}
- \setinterfaceelement {complex} {complex}
- \setinterfaceelement {simple} {simple}
- \setinterfaceelement {use} {use}
- \setinterfaceelement {define} {define}
- \setinterfaceelement {flush} {flush}
+ \setinterfaceelement {set} {set}
+ \setinterfaceelement {value} {value}
+ \setinterfaceelement {complex} {complex}
+ \setinterfaceelement {simple} {simple}
+ \setinterfaceelement {use} {use}
+ \setinterfaceelement {define} {define}
+ \setinterfaceelement {flush} {flush}
\stopinterface
% Placeholders for the messages:
%
% 1: letter|resume / interface|style|extension / filename
% 2: letter|resume / interface|style|extension / filename
-% 3: <number> / <number>
+% 3: ‹number› / ‹number›
\definemessageconstant {correspondence}
@@ -301,7 +304,12 @@
{\getparameters[#2#3][#4]}
\def\dosetupcorrespondencedescription[#1][#2][#3][#4]%
- {\setupdescriptions[#2#3][#4]}
+ {\setupdescriptions[#1:#3][#4]}
+
+% used in the upcoming version
+%
+% \def\dosetupcorrespondencedescription[#1][#2][#3][#4]%
+% {\getparameters[#1#3][#4]}
\def\dosetupcorrespondencelayer[#1][#2][#3][#4]%
{\dodosetupcorrespondencelayer[#1][#2][#3][\v!layer,\v!frame,\v!option][#4]}
@@ -532,7 +540,7 @@
{\setvalue{#1:#2:#3}{\v!section}%
\appendtovaluelist{#1!list!sections}{#3}}%
\getparameters
- [#2#3]%
+ [#2#3]
[\c!before=,
\c!after=,
\c!align=,
@@ -564,26 +572,88 @@
%D Descriptions
+%D I use \CONTEXT's own description environment to format the appendices,
+%D but the mechanism is to complex for such the cases I need in my module
+%D and the code will be replaced in the future by my own code.
+
\def\definecorrespondencedescription[#1][#2]%
{\setvalue{\s!do\e!define#1\v!description}{\dodefinecorrespondencedescription[#1][#2]}%
\setvalue{\s!do\e!set #1\v!description}{\dosetcorrespondencedescription [#1][#2]}%
\setvalue{\s!do\e!flush #1\v!description}{\doflushcorrespondencedescription [#1][#2]}}
+% \def\dodefinecorrespondencedescription[#1][#2][#3]%
+% {\setvalue{#2\v!option#3}{\v!yes}%
+% \doifundefined{#1:#2:#3}
+% {\setvalue{#1:#2:#3}{\v!description}%
+% \appendtovaluelist{#1!list!descriptions}{#3}}%
+% \definedescription
+% [#1:#3]
+% [\c!location=\v!top,
+% \c!inbetween=\nowhitespace]}
+%
+% \def\dosetcorrespondencedescription[#1][#2][#3]%
+% {\doiftext{\directsetup{#1:#3}}
+% {\csname\e!start#1:#3\endcsname{\labeltext{#1:#3}}
+% \directsetup{#1:#3}%
+% \csname\e!stop #1:#3\endcsname}}
+%
+% \def\doflushcorrespondencedescription[#1][#2]%
+% {\def\dodoflushcorrespondencedescription##1%
+% {\doif{\correspondencestylevalue{#2}\v!option{##1}}\v!yes{\dosetcorrespondencedescription[#1][#2][##1]}}%
+% \processcommacommand[\csname#1!list!descriptions\endcsname]\dodoflushcorrespondencedescription}
+
\def\dodefinecorrespondencedescription[#1][#2][#3]%
{\setvalue{#2\v!option#3}{\v!yes}%
- \doifundefined{#1:#2:#3}
- {\setvalue{#1:#2:#3}{\v!description}%
- \appendtovaluelist{#1!list!descriptions}{#3}}%
- \definedescription
- [#1#3]
- [\c!location=\v!top,
- \c!inbetween=\nowhitespace]}
+ \doifundefined{#1:#2:#3}{\setvalue{#1:#2:#3}{\v!description}}%
+ \getparameters
+ [#2#3]
+ [\c!location=\v!left,
+ \c!inbetween=\nowhitespace,
+ \c!before=\blank,
+ \c!after=\blank,
+ \c!width=\v!broad,
+ \c!distance=\zeropoint]}
\def\dosetcorrespondencedescription[#1][#2][#3]%
- {\doiftext{\directsetup{#1:#3}}
- {\csname\e!start#1#3\endcsname{\labeltext{#1:#3}}
- \directsetup{#1:#3}%
- \csname\e!stop #1#3\endcsname}}
+ {\bgroup
+ \doifelsecorrespondencestylevalue{#2}{#3}\c!before
+ {\correspondencestylevalue{#2}{#3}\c!before}
+ \endgraf
+ \setbox\scratchbox\hbox{\labeltext{#1:#3}}%
+ \ifdim\wd\scratchbox>\zeropoint
+ \processaction
+ [\correspondencestylevalue{#2}{#3}\c!width]
+ [ \v!fit=>\scratchdimen\dimexpr\wd\scratchbox+\correspondencestylevalue{#2}{#3}\c!distance\relax,
+ \v!broad=>\scratchdimen\dimexpr\wd\scratchbox+1em\relax,
+ \s!unknown=>\scratchdimen\dimexpr\correspondencestylevalue{#2}{#3}\c!width+\correspondencestylevalue{#2}{#3}\c!distance\relax]%
+ \else
+ \processaction
+ [\correspondencestylevalue{#2}{#3}\c!width]
+ [ \v!fit=>\scratchdimen\zeropoint,
+ \v!broad=>\scratchdimen\zeropoint,
+ \s!unknown=>\scratchdimen\dimexpr\correspondencestylevalue{#2}{#3}\c!width+\correspondencestylevalue{#2}{#3}\c!distance\relax]%
+ \fi
+ \executeifdefined{\v!correspondence\v!description\correspondencestylevalue{#2}{#3}\c!location}\gobblethreearguments{#1}{#2}{#3}%
+ \doifelsecorrespondencestylevalue{#2}{#3}\c!after
+ {\endgraf\correspondencestylevalue{#2}{#3}\c!after}
+ \endgraf
+ \egroup}
+
+\setvalue{\v!correspondence\v!description\v!left}#1#2#3%
+ {\hangindent\scratchdimen
+ \hangafter\zerocount
+ \setbox\scratchbox\hbox\!!to\scratchdimen{\box\scratchbox\hss}%
+ \noindent\llap{\box\scratchbox}\directsetup{#1:#3}}
+
+\setvalue{\v!correspondence\v!description\v!top}#1#2#3%
+ {\box\scratchbox\par
+ \nobreak
+ \doifcorrespondencestylevalue{#2}{#3}\c!inbetween{\correspondencestylevalue{#2}{#3}\c!inbetween}%
+ \nobreak
+ \directsetup{#1:#3}}
+
+\setvalue{\v!correspondence\v!description\v!text}#1#2#3%
+ {\noindent\box\scratchbox\directsetup{#1:#3}}
\def\doflushcorrespondencedescription[#1][#2]%
{\def\dodoflushcorrespondencedescription##1%
diff --git a/Master/texmf-dist/tex/context/third/letter/interface/default.nli b/Master/texmf-dist/tex/context/third/letter/interface/default.nli
index 4809c7ebd70..4954da130b4 100644
--- a/Master/texmf-dist/tex/context/third/letter/interface/default.nli
+++ b/Master/texmf-dist/tex/context/third/letter/interface/default.nli
@@ -1,6 +1,6 @@
%D \module
%D [ file=default,
-%D version=2009.02.14,
+%D version=2009.02.17,
%D title=\CONTEXT\ Letter Interface,
%D subtitle=Default Interface,
%D author=Wolfgang Schuster,
@@ -9,8 +9,6 @@
%D email=schuster.wolfgang@googlemail.com,
%D license=Public Domain]
-%M \loadsetups[t-letter.xml]
-
\unprotect
%D \subject{Reference line}
@@ -221,28 +219,6 @@
%D the opening and closing with the optional argument, the values are
%D local in this case and not global like the values you could set with
%D \tex{setupletter}.
-%D
-%D \showsetup{startletter}
-
-% \def\startletter
-% {\bgroup\dodoubleempty\dostartletter}
-%
-% \def\dostartletter[#1][#2]%
-% {\ifsecondargument
-% \getparameters[\????ld][#1]%
-% \doifundefinedelse{\????ld\????ld#2}
-% {\setvalue{\????ld\c!toaddress}{#2}}
-% {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#2}}}%
-% \else\iffirstargument
-% \doifassignmentelse{#1}
-% {\getparameters[\????ld][#1]}
-% {\doifundefinedelse{\????ld\????ld#1}
-% {\setvalue{\????ld\c!toaddress}{#1}}
-% {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#1}}}}%
-% \fi\fi
-% \def\stopletter
-% {\directsetup{\v!letter:\v!place}\egroup}%
-% \dostartbuffer[lettercontent][startletter][stopletter]}
\long\def\dosetbuffer[#1]#2\endbuffer % added \long
{\begingroup
@@ -258,7 +234,7 @@
\getparameters[\????ld][#1]%
\doifundefinedelse{\????ld\????ld#2}
{\setvalue{\????ld\c!toaddress}{#2}}
- {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#2}}}%
+ {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#2}}}%
\else\iffirstargument
\doifassignmentelse{#1}
{\getparameters[\????ld][#1]}
@@ -267,29 +243,25 @@
{\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#1}}}}%
\fi\fi
\setbuffer[lettercontent]#3\endbuffer
+ \processlettervalues
\directsetup{\v!letter:\v!place}\egroup}
-% %D Patched version of the \tex{flushbufferline} macro for \MKII,
-% %D the changes are definition as long and removing of \tex{string}
-% %D in the argument of the last write block.
-%
-% \long\def\flushbufferline#1%
-% {\iftmpblockstarted
-% \ifsegmentatebuffer
-% \ifemptybufferline
-% \immediate\write\tmpblocks{\string\stopbufferparagraph }%
-% \immediate\write\tmpblocks{\string\startbufferparagraph}%
-% \else
-% \immediate\write\tmpblocks{#1}%
-% \fi
-% \else
-% \immediate\write\tmpblocks{#1}%
-% \fi
-% \else
-% \doifsomething{#1}
-% {\tmpblockstartedtrue
-% \immediate\write\tmpblocks{#1}}%
-% \fi}
+\newtoks\letter!local!commands
+
+\def\processlettervalues
+ {\global\let\letter!list!descriptions\empty
+ \global \letter!local!commands \emptytoks
+ \def\opening##1{\doglobal\appendtoks\setvalue{\????ld\c!opening }{##1}\to\letter!local!commands}%
+ \def\closing##1{\doglobal\appendtoks\setvalue{\????ld\c!closing }{##1}\to\letter!local!commands}%
+ \def\ps ##1{\doglobal\appendtoks\setvalue{\????ld\c!postscript}{##1}\to\letter!local!commands\doglobal\appendtocommalist\c!postscript\letter!list!descriptions}%
+ \def\cc ##1{\doglobal\appendtoks\setvalue{\????ld\c!copy }{##1}\to\letter!local!commands\doglobal\appendtocommalist\c!copy \letter!list!descriptions}%
+ \def\encl ##1{\doglobal\appendtoks\setvalue{\????ld\c!enclosure }{##1}\to\letter!local!commands\doglobal\appendtocommalist\c!enclosure \letter!list!descriptions}%
+ \setbox\scratchbox\hbox{\getbuffer[lettercontent]}%
+ \flushtoks\letter!local!commands}
+
+\def\gobblelettervalues
+ {\def\dogobblelettervalues##1{\letcsnamecs\csname##1\endcsname\gobbleoneargument}%
+ \processcommalist[\c!opening,\c!closing,\c!ps,\c!cc,\c!encl]\dogobblelettervalues}
%D \macros
%D {startlettercontent}
@@ -463,7 +435,7 @@
\stopsetups
\startsetups[\v!letter:\v!content]
-\lettervalue\c!content
+\gobblelettervalues\lettervalue\c!content
\stopsetups
%D \subject{Closing and appendices}
@@ -504,28 +476,19 @@
\dodefineletterdescription[\v!enclosure]
\startsetups[\v!letter:\v!enclosure]
-\processaction
- [\lettervalue\c!enclosure]
- [ \v!empty=>\vrule\!!height\zeropoint\!!depth\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
- \s!unknown=>\lettervalue\c!enclosure]
+\lettervalue\c!enclosure
\stopsetups
\dodefineletterdescription[\v!copy]
\startsetups[\v!letter:\v!copy]
-\processaction
- [\lettervalue\c!copy]
- [ \v!empty=>\vrule\!!height\zeropoint\!!depth\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
- \s!unknown=>\lettervalue\c!copy]
+\lettervalue\c!copy
\stopsetups
\dodefineletterdescription[\v!postscript]
\startsetups[\v!letter:\v!postscript]
-\processaction
- [\lettervalue\c!postscript]
- [ \v!empty=>\vrule\!!height\zeropoint\!!depth\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
- \s!unknown=>\lettervalue\c!postscript]
+\lettervalue\c!postscript
\stopsetups
\setvalue{\v!letter:\v!backaddress:\v!yes}%
@@ -554,7 +517,7 @@
%D the elements.
\defineblankmethod [\v!nobreak] {\penalty\plustenthousand}
-\defineblankmethod [\v!endgraf] {\endgraf}
+\defineblankmethod [\v!endgraf] {\endgraf }
%D \subject{Additional settings}
%D