summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/letter/base/t-letter.tex
blob: c46299fd6ce10c987eb41ae0dc2fc3b3d54c4f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
%D \module
%D   [       file=t-letter,
%D        version=2008.12.25,
%D          title=\CONTEXT\ User Module,
%D       subtitle=Framework for Letters,
%D         author=Wolfgang Schuster,
%D           date=\currentdate,
%D      copyright=Wolfgang Schuster,
%D          email=schuster.wolfgang@googlemail.com,
%D        license=Public Domain]

%M \loadsetups[cont-en.xml]
%M \loadsetups[t-letter.xml]

%D \subject{Constants and Variables}

\writestatus{loading}{Context User Module / Framework for Letters}

\unprotect

\usemodule[correspondence]

%D Before we start the real module let us introduce two namespaces
%D for the style and content setup commands.

\def\????ld{@@@@ld} % LetterData
\def\????ls{@@@@ls} % LetterStyle

\startmodule[letter]

\setupmodule
  [\c!style=,            % default letter style
   \c!extension=,        % default letter extension
   \c!interface=default] % default letter interface

%D \subject{Setup commands}
%D 
%D \macros
%D   {setupletterstyle}
%D 
%D The layout for the first page could be set with the \mono{firstpage}
%D key and the layout for the second and all following pages with the
%D \mono{secondpage} key. You could use any key and value from
%D \type{\setuplayout} to set your own letter layout.
%D 
%D \showsetup{setupletterstyle:layout}
%D 
%D The header and footer texts for the letter is set with the \mono{header}
%D and \mono{footer} keys, the text itself I written as argument as one of
%D the three keys. The command itself has no option to use different texts
%D for odd and even pages (if you really want this in a letter) but you could
%D solve this with the macro \type{\doifoddpageelse}, I will give you a short
%D example below.

\setvalue{\v!letter:\????ls:\v!firstpage }{\v!layout}
\setvalue{\v!letter:\????ls:\v!secondpage}{\v!layout}

\definecorrespondencesetup[\v!letter\v!style][\v!letter][\????ls]

%D \macros
%D   {setupletter}

\definecorrespondencevalue[\v!letter][\????ld]

%D A few extra macros to test for content of the letter values, don't rely
%D on them at the moment because they could change or I will remove, rename,
%D rewrite etc. them.
%D 
%D With the change of the \type{\setupletter} command it was also necessary
%D to change the definition for lettervalue tests.

\def\doiflettervalue         {\doifcorrespondencevalue         \????ld}
\def\doifelselettervalue     {\doifelsecorrespondencevalue     \????ld}
\def\doifletterstylevalue    {\doifcorrespondencestylevalue    \????ls}
\def\doifelseletterstylevalue{\doifelsecorrespondencestylevalue\????ls}

%D \subject{Interface, Style and Extension files}
%D 
%D \macros
%D   {useletterextension,useletterstyle,useletterinterface}
%D
%D This module provides different types of files beside the main module.
%D 
%D Two of them could be used by the user while the third is only used in
%D this file but you're free to use but you should really now what you do.
%D 
%D Each of the files has it's own file extension, you have to use if you
%D want to create such a file, this has the advantage to use the same name
%D for a collection of macros.

\definefileconstant {letterstyle}     {nls}
\definefileconstant {letterextension} {nle}
\definefileconstant {letterinterface} {nli}

%D Let us begin now to talk about the different types of files.
%D 
%D \subsubject{letter interface}
%D 
%D The letter interface provides the connection between the user and the
%D inner macros, it is possible to write a letter without a interface but
%D you will loose many of the nice features. The features itself are defined
%D within the interface and try to help the user to write a letter in
%D a simpler than the raw interface.
%D 
%D I want to show you the difference between the default interface and the
%D raw backend with a simple example, just a opening, the content and
%D a closing text.
%D 
%D The example with the default interface looks like:
%D 
%D \starttyping
%D \startletter
%D   [opening=Hello User,
%D    closing=Good luck with your own interface]
%D I will show you how you could write a letter with my letter module
%D and the difference between the default and the raw interface. The raw
%D interface is should be only used by a high level interface and not the
%D user but you're free to do it.
%D \stopletter
%D \stoptyping
%D 
%D The same example with the raw interface looks like:
%D 
%D \starttyping
%D \startsetups[letter:opening]
%D Hello User
%D \stopsetups
%D 
%D \startsetups[letter:content]
%D I will show you how you could write a letter with my letter module
%D and the difference between the default and the raw interface. The raw
%D interface is should be only used by a high level interface and not the
%D user but you're free to do it.
%D \stopsetups
%D 
%D \startsetups[letter:closing]
%D Good luck with your own interface
%D \stopsetups
%D \stoptyping
%D 
%D The interface itself is loaded with the \type{\useletterinterface}
%D command but you could also use the optional argument for \type{\usemodule}
%D to load it. The first is only used in this file but it makes sense
%D to use it also in a wrapper file for your own interface.
%D
%D \showsetup{useletterinterface}

\definecorrespondencefile[\v!letter][\v!interface][\f!letterinterface]

%D \subsubject{letter extension}
%D 
%D The second filetype this module supports are letterextensions, you
%D could use it to save macros and other values you want to use in many
%D without the need to put it always in the real letter.
%D 
%D A few reasons for a letterextension file are:
%D 
%D \startitemize[packed,intro]
%D \item The letter head from your company,
%D \item your own macro for the reference line,
%D \item labels you need in different files (see \mono{label.nle}),
%D \item \unknown
%D \stopitemize
%D 
%D The syntax to load a letterextension file is the same as for a interface
%D and you could also argument for \type{\usemodule}.
%D 
%D \showsetup{useletterextension}

\definecorrespondencefile[\v!letter][\v!extension][\f!letterextension]

%D \subsubject{letter styles}
%D 
%D After I mentioned above how to load a interface and extension
%D I will now come to the most important extension for the module.
%D 
%D Letter styles are used to change the layout of the letter,
%D set the values for layers and enable and disable common options.
%D Although it is possible to do all these things in the letter itself
%D it is better to save often used settings in a extra file you could
%D load on demand and share between your letters.
%D 
%D You could load a style file in the same way as the other to files,
%D the first is \type{\useletterstyle} and the second the optional argument
%D for \type{\usemodule}.
%D 
%D \showsetup{useletterstyle}

\definecorrespondencefile[\v!letter][\v!style][\f!letterstyle]

%D \macros
%D   {letterstylevalue,lettervalue}
%D 
%D The two commands \type{\letterstylevalue} and \type{\lettervalue} could
%D be used to access the values for the keys used in the letterstyle
%D settings and the letter values for information.

%D The rest of module contains only internal macros and other settings,
%D you don't need them as a normal user but you look at the default.

\def\letterstylevalue#1#2%
  {\csname\????ls#1#2\endcsname}

%D The old definition of \type{\lettervalue} required two arguments.
%D 
%D \starttyping
%D \def\lettervalue#1#2%
%D   {\csname\????ld#1#2\endcsname}
%D \stoptyping
%D 
%D The new definition needs only one arguments because \type{\setupletter}
%D needs only one argument for the values in the new version.

\def\lettervalue#1%
  {\csname\????ld#1\endcsname}

\let\letter!list!layers      \empty
\let\letter!list!sections    \empty
\let\letter!list!descriptions\empty

\def\letter!list!marking
  {\v!topmark,\v!botmark,\v!cutmark,\v!endmark,\v!usermark}

\def\letter!list!header
  {\v!head,\v!nexthead,\v!lefthead,\v!righthead}

\def\letter!list!footer
  {\v!foot,\v!nextfoot,\v!leftfoot,\v!rightfoot}

\definecorrespondencelayer      [\v!letter][\????ls]
\definecorrespondencesection    [\v!letter][\????ls]
\definecorrespondencedescription[\v!letter][\????ls]

%D \subject{Placement of the content}
%D 
%D Enable the layouts for the first and second page.

\startsetups[\v!letter:\v!layout]

  \setuplayout[\v!letter\v!firstpage]

  \appendtoks\setuplayout[\v!letter\v!secondpage]\to\everyaftershipout

\stopsetups

%D Header for the first page, you could use it to place the logo from your
%D company or your own address and name.

\dodefineletterlayer[\v!header]

\startsetups[\v!letter:\v!place:\v!head]

  % First page

  \startlocalsetups[\v!letter:\v!place:\v!firsthead]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!head]

  \stoplocalsetups

  % Following pages

  \startlocalsetups[\v!letter:\v!place:\v!nexthead]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!nexthead]

  \stoplocalsetups

  % Left pages

  \startlocalsetups[\v!letter:\v!place:\v!lefthead]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!lefthead]

  \stoplocalsetups

  % Right pages

  \startlocalsetups[\v!letter:\v!place:\v!righthead]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!righthead]

  \stoplocalsetups

  \doif\@@@@lsoptionhead     \v!yes{\directsetup{\v!letter:\v!place:\v!firsthead}}
  \doif\@@@@lsoptionnexthead \v!yes{\directsetup{\v!letter:\v!place:\v!nexthead }}
  \doif\@@@@lsoptionlefthead \v!yes{\directsetup{\v!letter:\v!place:\v!lefthead }}
  \doif\@@@@lsoptionrighthead\v!yes{\directsetup{\v!letter:\v!place:\v!righthead}}

\stopsetups

%D Address

\dodefineletterlayer[\v!address]

\startsetups[\v!letter:\v!place:\v!address]

  \dosetletterlayer[\v!address]

\stopsetups

%D Could be used to place a backaddress above the normal address.

\dodefineletterlayer[\v!backaddress]

\startsetups[\v!letter:\v!place:\v!backaddress]

  \dosetletterlayer[\v!backaddress]

\stopsetups

%D Reference line

\dodefineletterlayer[\v!reference]

\startsetups[\v!letter:\v!place:\v!reference]

  \dosetletterlayer[\v!reference]

\stopsetups

%D Location field

\dodefineletterlayer[\v!location]

\startsetups[\v!letter:\v!place:\v!location]

  \dosetletterlayer[\v!location]

\stopsetups

%D Footer block, you could use it to place information about your company
%D but take care set \type {repeat=yes} if you want to place it on every page,
%D you should disable the footer for the second and following pages inb this
%D case.

\dodefineletterlayer[\v!footer]

\startsetups[\v!letter:\v!place:\v!foot]

  % First page

  \startlocalsetups[\v!letter:\v!place:\v!firstfoot]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!foot]

  \stoplocalsetups

  % Following pages

  \startlocalsetups[\v!letter:\v!place:\v!nextfoot]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!nextfoot]

  \stoplocalsetups

  % Left pages

  \startlocalsetups[\v!letter:\v!place:\v!leftfoot]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!leftfoot]

  \stoplocalsetups

  % Right pages

  \startlocalsetups[\v!letter:\v!place:\v!rightfoot]

    \dosetheaderfooterlayer[\v!letter][\????ls][\v!rightfoot]

  \stoplocalsetups

  \doif\@@@@lsoptionfoot     \v!yes{\directsetup{\v!letter:\v!place:\v!firstfoot}}
  \doif\@@@@lsoptionnextfoot \v!yes{\directsetup{\v!letter:\v!place:\v!nextfoot }}
  \doif\@@@@lsoptionleftfoot \v!yes{\directsetup{\v!letter:\v!place:\v!leftfoot }}
  \doif\@@@@lsoptionrightfoot\v!yes{\directsetup{\v!letter:\v!place:\v!rightfoot}}

\stopsetups

%D Two additional layers from Hans Hagen's own letter module, it provide
%D for users who used \filename{m-letter.tex} and want to switch to my module.
%D 
%D I need they also for my pragma letter interface.

\dodefineletterlayer[\v!lettermain]

\startsetups[\v!letter:\v!place:\v!lettermain]

  \dosetletterlayer[\v!lettermain]

\stopsetups

\dodefineletterlayer[\v!letternext]

\startsetups[\v!letter:\v!place:\v!letternext]

  \dosetletterlayer[\v!letternext]

\stopsetups

%D Letterhead, american only

\dodefinelettersection[\v!letter\v!head]

\startsetups[\v!letter:\v!place:\v!letter\v!head]

  \dosetlettersection[\v!letter\v!head]

\stopsetups

%D Date Line, american only

\dodefinelettersection[\v!date\v!line]

\startsetups[\v!letter:\v!place:\v!date\v!line]

  \dosetlettersection[\v!date\v!line]

\stopsetups

%D Reference Line, american only

\dodefinelettersection[\v!reference\v!line]

\startsetups[\v!letter:\v!place:\v!reference\v!line]

  \dosetlettersection[\v!reference\v!line]

\stopsetups

%D Special Notation, american only

\dodefinelettersection[\v!special\v!notation]

\startsetups[\v!letter:\v!place:\v!special\v!notation]

  \dosetlettersection[\v!special\v!notation]

\stopsetups

%D Inside Address, american only

\dodefinelettersection[\v!inside\v!address]

\startsetups[\v!letter:\v!place:\v!inside\v!address]

  \dosetlettersection[\v!inside\v!address]

\stopsetups

%D Title

\dodefinelettersection[\v!title]

\startsetups[\v!letter:\v!place:\v!title]

  \dosetlettersection[\v!title]

\stopsetups

%D Subject

\dodefinelettersection[\v!subject]

\startsetups[\v!letter:\v!place:\v!subject]

  \dosetlettersection[\v!subject]

\stopsetups

%D Opening

\dodefinelettersection[\v!opening]

\startsetups[\v!letter:\v!place:\v!opening]

  \dosetlettersection[\v!opening]

\stopsetups

%D Letter content

\dodefinelettersection[\v!content]

\startsetups[\v!letter:\v!place:\v!content]

  \begingroup

  \doifletterstylevalue\v!option\c!indenting{\setupindenting[\@@@@lsoptionindenting]}

  \executeifdefined{\v!letter\v!content\s!start\c!optimize\@@@@lscontentoptimize}\donothing
  \dosetlettersection[\v!content]
  \executeifdefined{\v!letter\v!content\s!stop \c!optimize\@@@@lscontentoptimize}\donothing

  \endgroup

\stopsetups

%D Closing

\dodefinelettersection[\v!closing]

\startsetups[\v!letter:\v!place:\v!closing]

  \dosetlettersection[\v!closing]

\stopsetups

%D Appendices

\dodefinelettersection[\v!appendices]

\startsetups[\v!letter:\v!place:\v!appendices]

  \dosetlettersection[\v!appendices]

\stopsetups

%D Fold- and cutmarks, you enable and disable all of them independant
%D from any other or disable all marks with just one command.

\dodefineletterlayer[\v!foldmark]

\startsetups[\v!letter:\v!place:\v!foldmark]

  % Upper foldmark

  \startlocalsetups[\v!letter:\v!place:\v!topmark]

    \dosetletterlayer[\v!topmark]

  \stoplocalsetups

  % Lower foldmark

  \startlocalsetups[\v!letter:\v!place:\v!botmark]

    \dosetletterlayer[\v!botmark]

  \stoplocalsetups

  % Cutmark

  \startlocalsetups[\v!letter:\v!place:\v!cutmark]
	
    \dosetletterlayer[\v!cutmark]

  \stoplocalsetups

  % Endmark, a relict from the typewriter area

  \startlocalsetups[\v!letter:\v!place:\v!endmark]

    \dosetletterlayer[\v!endmark]

  \stoplocalsetups

  % Free mark, you could use it to place your own symbols

  \startlocalsetups[\v!letter:\v!place:\v!usermark]

    \dosetletterlayer[\v!usermark]

  \stoplocalsetups

  \doif\@@@@lsoptiontopmark \v!yes{\directsetup{\v!letter:\v!place:\v!topmark }}
  \doif\@@@@lsoptionbotmark \v!yes{\directsetup{\v!letter:\v!place:\v!botmark }}
  \doif\@@@@lsoptioncutmark \v!yes{\directsetup{\v!letter:\v!place:\v!cutmark }}
  \doif\@@@@lsoptionendmark \v!yes{\directsetup{\v!letter:\v!place:\v!endmark }}
  \doif\@@@@lsoptionusermark\v!yes{\directsetup{\v!letter:\v!place:\v!usermark}}

\stopsetups

%D Background graphic:

\defineoverlay
  [\v!letter:\c!backgroundimage]
  [\doifletterstylevalue\v!option\c!backgroundimage
     {\overlayfigure{\@@@@lsoptionbackgroundimage}}]

\defineoverlay
  [\v!letter:\c!background]
  [\@@@@lsoptionbackground]

\def\letter!list!backgrounds
  {\v!letter:\c!backgroundimage,\v!letter:\c!background,\v!letter:\v!head,%
   \v!letter:\v!letternext,\v!letter:\v!lettermain,\v!letter:\v!foot,%
   \v!letter:\v!address,\v!letter:\v!reference,\v!letter:\v!location,%
   \v!letter:\v!nexthead,\v!letter:\v!lefthead,\v!letter:\v!righthead,%
   \v!letter:\v!nextfoot,\v!letter:\v!leftfoot,\v!letter:\v!rightfoot,%
   \v!letter:\v!topmark,\v!letter:\v!botmark,\v!letter:\v!cutmark,%
   \v!letter:\v!endmark,\v!letter:\v!usermark,\v!letter:\v!backaddress}

%D Settings at the begin of every letter.

\startsetups[\v!letter:\v!initialize]

  \@@@@lsoptionbefore

  \begingroup

  \page[\@@@@lsoptionpage]

  \setupsubpagenumber
    [\c!number=\@@@@lsoptionpagenumber,
     \c!way=\v!by\v!text,
     \c!state=\v!start]

  \setuppagenumbering
    [\c!alternative=\@@@@lsoptionalternative,
     \c!location=] % use the header and footer option instead

  \setupbackgrounds
    [\v!paper]
    [\c!background=\v!color,
     \c!backgroundcolor=\@@@@lsoptionbackgroundcolor]

  \setupbackgrounds
    [\v!page]
    [\c!setups={\v!letter:\v!place:\v!head,\v!letter:\v!place:\v!foot},
     \c!background=\letter!list!backgrounds,
     \c!backgroundcolor=\@@@@lsoptionbackgroundcolor]

  \doifletterstylevalue\v!option\c!bodyfont  {\setupbodyfont  [\@@@@lsoptionbodyfont  ]}
  \doifletterstylevalue\v!option\c!whitespace{\setupwhitespace[\@@@@lsoptionwhitespace]}

\stopsetups

%D Settings at the end of every letter.

\startsetups[\v!letter:\v!finish]

  \page[\@@@@lsoptionpage]

  \setuplayout[\v!reset]

  \resetsubpagenumber

  \endgroup

  \@@@@lsoptionafter

\stopsetups

%D Place the letter.

\startsetups[\v!letter:\v!place]

  \directsetup{\v!letter:\v!initialize} % Settings at the begin
  \directsetup{\v!letter:\v!optimize  } % Interface dependend
  \directsetup{\v!letter:\v!layout    } % Page layout
  \directsetup{\v!letter:\v!reset     } % Reset layers
  \directsetup{\v!letter:\v!layer     } % Place layers
  \directsetup{\v!letter:\v!sequence  } % Place content
  \directsetup{\v!letter:\v!finish    } % Settings at the end

\stopsetups

%D Reset the layer content.

\def\letter!list!resetlayers
  {\v!topmark,\v!botmark,\v!cutmark,\v!endmark,\v!usermark,\v!letternext,\v!lettermain}

\def\dodoresetletterlayer#1%
  {\resetlayer[\v!letter:#1]}

\startsetups[\v!letter:\v!reset]

  \processcommacommand[\letter!list!resetlayers]\dodoresetletterlayer
  
  \setuplayer[\v!letter:\v!letternext][\c!state=\v!continue]

\stopsetups

\startsetups[\v!letter:\v!layer]

  \doif\@@@@lsoptionmarking    \v!yes{\directsetup{\v!letter:\v!place:\v!foldmark   }}
  \doif\@@@@lsoptionbackaddress\v!yes{\directsetup{\v!letter:\v!place:\v!backaddress}}
  \doif\@@@@lsoptionaddress    \v!yes{\directsetup{\v!letter:\v!place:\v!address    }}
  \doif\@@@@lsoptionreference  \v!yes{\directsetup{\v!letter:\v!place:\v!reference  }}
  \doif\@@@@lsoptionlocation   \v!yes{\directsetup{\v!letter:\v!place:\v!location   }}
  \doif\@@@@lsoptionlettermain \v!yes{\directsetup{\v!letter:\v!place:\v!lettermain }}
  \doif\@@@@lsoptionletternext \v!yes{\directsetup{\v!letter:\v!place:\v!letternext }}

\stopsetups

%D Place the letter content.

\let\letter!order!sections\letter!list!sections

\def\doflushlettersection#1%
  {\doif{\letterstylevalue\v!option{#1}}\v!yes{\directsetup{\v!letter:\v!place:#1}}}

\startsetups[\v!letter:\v!sequence]

  \executeifdefined{\v!letter\s!start\c!optimize\@@@@lsoptionoptimize}\donothing
  \processcommacommand[\letter!order!sections]\doflushlettersection
  \executeifdefined{\v!letter\s!stop \c!optimize\@@@@lsoptionoptimize}\donothing

\stopsetups

%D \subject{Default values}
%D 
%D Default settings for the option values of the letter.

\setvalue{\v!letter:\????ls:\v!option}{\v!option}

\setupletterstyle
  [\v!option]
  [\c!marking=\v!yes,
   \c!endmark=\v!no,
   \c!usermark=\v!no,
   \c!backaddress=\v!no,
   \c!indenting=,
   \c!whitespace=,
   \c!background=,
   \c!backgroundcolor=\v!white,
   \c!backgroundimage=,
   \c!before=,
   \c!after=,
   \c!page=\v!yes,
   \c!pagenumber=\plusone,
   \c!bodyfont=,
   \c!optimize=\v!no,
   \c!alternative=\v!singlesided]

% interface always before styles and extension because users should
% start with a clean interface without predefined and unwanted values.

\useletterinterface[\currentmoduleparameter\c!interface]
\useletterstyle    [\currentmoduleparameter\c!style    ]
\useletterextension[\currentmoduleparameter\c!extension]

%D The special style \mono{user} is not included in the archive and has
%D to be written by the user itself, it can be used to set default values
%D for personal letters and to load additional extensions and styles.

\useletterstyle[user] % don't rely on the name, it can change for the moment

\stopmodule

\protect \endinput