File: codorg.htm

package info (click to toggle)
mh-book 9910-2
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 8,104 kB
  • ctags: 2,979
  • sloc: sh: 1,449; perl: 771; ansic: 279; makefile: 48; csh: 8
file content (290 lines) | stat: -rw-r--r-- 9,126 bytes parent folder | download | duplicates (2)
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
<HTML>
<HEAD>
<META NAME="Author" CONTENT="Brent B. Welch">
<TITLE>MH &amp; nmh: Code Organization</TITLE>
</HEAD>
<!-- $Id: codorg.htm,v 6.0 1999/10/10 05:14:05 jpeek Exp $ -->

<BODY BGCOLOR="#FFFFFF">
<H1>Code Organization</H1>
[<A HREF="proexm.htm">previous</A>]
[<A HREF="../mh/ap-wcygf.htm">next</A>]
[<A HREF="tocs/jump.htm">table of contents</A>] [<A HREF="indexes/map.htm">index</A>]
<P>

I've tried to split <I>exmh</I> into meaningful modules,
separating display modules (<I>fdisp</I>, for instance) from those that
maintain display-independent data structures (like <I>flist</I>).
Features like the <TT>Find</TT> and <TT>Pick</TT> dialogs are in their own file,
so you can easily replace those.
I have not documented the interfaces between modules at all,
so you'll have to read some code.
It's easy to find definitions:
the <I>.tcl</I> file names reflect the names of the procedures that
they define.
In addition, many modules use a global array to hold
their state variables; this array variable has the same name
as the module.
<P>
If you are really interested in the internals of <I>exmh</I>
(that is, if something about it really bugs you!), you can look into
the implementation to see what is wrong and how you
might do things better.
The following sections contain a list of the files that make up <I>exmh</I>
and short explanations of the Tcl procedures in each.
<H2><A NAME="MaiScr">Main Scripts</A></H2>
The sources are divided into two parts.
The main scripts include <I>exmh</I> and some associated utility scripts.
The files with the <I>.MASTER</I> suffix are patched with site-dependent
information before they are installed.  
The remaining sources are kept in a script library.
The library files are loaded on demand by the Tcl <I>auto_load</I> facility.
<DL>
<dt><I>exmh.MASTER</I></dt>
<dd>
This is the main script.
It gets patched with site-dependent information, and the results
are written to <I>exmh</I>, which gets installed.
<I>exmh.MASTER</I> doesn't define much because it loads almost everything
from the script library.
<dt><I>exmh-bg.MASTER</I></dt>
<dd>
This is the main script for the background process.
It redefines a few procedures and loads the rest of its
implementation from the library.
The initial rendezvous between the background process is implemented
in this script and in some supporting routines in <I>background.tcl</I>.
<dt><I>install.tcl</I></dt>
<dd>
These are supporting routines for the installation process.
This should be generic enough for use with your own Tcl application.
Feel free to borrow it.
<dt><I>exmh.install</I></dt>
<dd>
This is the installation script for <I>exmh</I>.
<dt><I>exmh-async</I></dt>
<dd>
This is the wrapper for external editors.
</DL>
<H2><A NAME="Library">Library</A></H2>
The remainder of the files are kept in the script library.
<DL>
<dt><I>aliases.tcl</I></dt>
<dd>
A browser for the MH alias file.
<dt><I>background.tcl</I></dt>
<dd>
The background processing module.
This can run in a separate process or as part of the main process.
The <TT>BgRPC</TT> routine is used to invoke a background operation, and
it works in either case.
<dt><I>bindings.tcl</I></dt>
<dd>
The default bindings and the implementation of the
binding user interface.
<dt><I>busy.tcl</I></dt>
<dd>
Three different ways to indicate that <I>exmh</I> is busy doing something.
<dt><I>buttons.tcl</I></dt>
<dd>
The resource-based button and menu implementation.
<dt><I>cutbuffer.tcl</I></dt>
<dd>
A stub for the C cutbuffer extension.
If you have added the extension to your <I>wish</I>,
you'll have slightly better cut-and-paste interoperability
with older X programs.
<dt><I>editor.tcl</I></dt>
<dd>
The interface to editors for message composition.
<dt><I>error.tcl</I></dt>
<dd>
The error handler.
<dt><I>extrasInit.tcl</I></dt>
<dd>
This has Init routines for optional modules.
The idea is to avoid loading the modules until
they are actually used.
<dt><I>exwin.tcl</I></dt>
<dd>
The main window display is set up here.
The code that remembers where top-level windows go is here.
<dt><I>faces.tcl</I></dt>
<dd>
The interface to the faces database.
<dt><I>fcache.tcl</I></dt>
<dd>
The folder cache display.
<dt><I>fdisp.tcl</I></dt>
<dd>
The main folder display.
<dt><I>fdispColor.tcl</I></dt>
<dd>
The color definitions for the folder display.
<dt><I>fdispPopup.tcl</I></dt>
<dd>
The nested folder popup implementation.
<dt><I>fileselect.tcl</I></dt>
<dd>
The file selection dialog.
<dt><I>find.tcl</I></dt>
<dd>
The find dialog.
<dt><I>flag.tcl</I></dt>
<dd>
Manages the appearance of the icon.
<dt><I>flist.tcl</I></dt>
<dd>
Manages the set of unseen folders.
<dt><I>folder.tcl</I></dt>
<dd>
Folder operations like <TT>Folder_Change</TT> and <TT>Folder_Commit</TT>.
<dt><I>folderNew.tcl</I></dt>
<dd>
The folder-create and -delete dialogs.
<dt><I>ftoc.tcl</I></dt>
<dd>
The folder table of contents (scan listing).
<dt><I>ftocColor.tcl</I></dt>
<dd>
Color definitions for the highlights in the table of contents.
<dt><I>ftocFind.tcl</I></dt>
<dd>
Routines that search over the table of contents.
<dt><I>help.tcl</I></dt>
<dd>
Some very simple help text and a color key.
<dt><I>import.tcl</I></dt>
<dd>
Routines to import folders from UCB mail.
<dt><I>inc.tcl</I></dt>
<dd>
Several ways to incorporate mail.
<dt><I>labels.tcl</I></dt>
<dd>
There are three labels in the display -- can you see them?
<dt><I>mailcap.tcl</I></dt>
<dd>
Routines to parse the MIME mailcap files.
<dt><I>main.tcl</I></dt>
<dd>
The main <TT>Exmh</TT> procedure, plus <TT>Exmh_Status</TT> and <TT>Exmh_Debug</TT>.
<dt><I>mh.tcl</I></dt>
<dd>
A basic layer on top of the MH commands.
<dt><I>mime.tcl</I></dt>
<dd>
The MIME display code.
<dt><I>msg.tcl</I></dt>
<dd>
Message operations -- although these tend to be distributed
partly among <I>ftoc.tcl</I> and <I>mh.tcl</I> as well.
<dt><I>msgShow.tcl</I></dt>
<dd>
This used to be the main message display code,
but it has become dwarfed by the MIME display.
<dt><I>pgp.tcl</I></dt>
<dd>
An interface to the Pretty Good Privacy system.
<dt><I>pick.tcl</I></dt>
<dd>
An interface to the MH <I>pick</I> program.
<dt><I>preferences.tcl</I></dt>
<dd>
The Preferences user interface.
<dt><I>print.tcl</I></dt>
<dd>
Routines to print messages.
<dt><I>rich2tk.tcl</I></dt>
<dd>
This parses <I>text/enriched</I> MIME contents.
<dt><I>scan.tcl</I></dt>
<dd>
This manages the scan caches.
<dt><I>sedit.tcl</I></dt>
<dd>
The main routines for the built-in editor.
<dt><I>seditBind.tcl</I></dt>
<dd>
The keybindings for the built-in editor.
<dt><I>seditCompose.tcl</I></dt>
<dd>
The table of compose key sequences that insert 8-bit characters is
defined here.
<dt><I>seditEnriched.tcl</I></dt>
<dd>
Implements the composition of <I>text/enriched</I>.
<dt><I>seditExtras.tcl</I></dt>
<dd>
More editor stuff, like <TT>Whom</TT>, <TT>Spell</TT>, <TT>Sign</TT>,
<TT>Find</TT>, and the dialogs associated with <TT>Insert Part</TT>.
<dt><I>seditMime.tcl</I></dt>
<dd>
Implements the MIME multipart structuring.
<dt><I>seditQP.tcl</I></dt>
<dd>
Support for <I>quoted-printable</I> encoding of outgoing messages.
<dt><I>select.tcl</I></dt>
<dd>
Implements the keyboard selection of folders and messages.
<dt><I>sound.tcl</I></dt>
<dd>
Sound effects.
<dt><I>text.tcl</I></dt>
<dd>
Some text tagging routines.
<dt><I>textButton.tcl</I></dt>
<dd>
An implementation of a pseudo-button in a text widget.
This used to be part of the MIME display code but
is no longer used.
<dt><I>textSelect.tcl</I></dt>
<dd>
The main guts of text bindings.
<dt><I>user.tcl</I></dt>
<dd>
Stubs for <TT>User_Init</TT> and <TT>User_Layout</TT>.
<dt><I>widgetMenu.tcl</I></dt>
<dd>
Support for the popup menus used in MIME messages.
<dt><I>widgetText.tcl</I></dt>
<dd>
Handles constrained text scrolling and dragging a selection off the
window.
<dt><I>widgets.tcl</I></dt>
<dd>
A basic layer on top of the Tk widgets.
These routines integrate the pack geometry manager.
Even more important, they guard
against errors that occur because of missing fonts.
You should try to use these instead of the straight
Tk widget commands.
<dt><I>xns.tcl</I></dt>
<dd>
An interface to <I>xnsgetmail</I> for those folks with mail on an XNS mail
server.
</DL>

<P ALIGN=CENTER>
[<A HREF="tocs/jump.htm">Table of Contents</A>] [<A HREF="indexes/map.htm">Index</A>]
[<A HREF="proexm.htm">Previous: Programming exmh</A>]
[<A HREF="../mh/ap-wcygf.htm">Next: Where Can You Go from Here?</A>]
</P>
<HR>
<EM>Last change $Date: 1999/10/10 05:14:05 $</EM>
<P>
This file is from the third edition of the book <I>MH &amp; xmh: Email
for Users &amp; Programmers</I>, ISBN 1-56592-093-7, by Jerry Peek.
Copyright &copy; 1991, 1992, 1995 by O'Reilly &amp; Associates, Inc.
This file is freely available; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.  For more information, see
<A HREF="../copying.htm">the file <I>copying.htm</I></A>.
<P>
<ADDRESS>
Suggestions are welcome:
<A HREF="http://www.beedub.com/exmh/">Brent Welch</A>
<A HREF="mailto:welch@acm.org">&lt;welch@acm.org&gt;</A>
</ADDRESS>
</BODY>
</HTML>