(select-safe-coding-system): If cdr
[bpt/emacs.git] / etc / BABYL
CommitLineData
a933dad1
DL
1Format of Version 5 Babyl Files:
2
ca4ac03d
GM
3(Babyl was the storage format used by Rmail before Emacs 23.1.
4Since then it uses mbox format.)
5
a933dad1
DL
6Warning:
7
8 This was written Tuesday, 12 April 1983 (by Eugene Ciccarelli),
9based on looking at a particular Babyl file and recalling various
10issues. Therefore it is not guaranteed to be complete, but it is a
11start, and I will try to point the reader to various Babyl functions
12that will serve to clarify certain format questions.
13
14 Also note that this file will not contain control-characters,
15but instead have two-character sequences starting with Uparrow.
16Unless otherwise stated, an Uparrow <character> is to be read as
17Control-<character>, e.g. ^L is a Control-L.
18
19Versions:
20
21 First, note that each Babyl file contains in its BABYL OPTIONS
22section the version for the Babyl file format. In principle, the
23format can be changed in any way as long as we increment the format
24version number; then programs can support both old and new formats.
25
26 In practice, version 5 is the only format version used, and the
27previous versions have been obsolete for so long that Emacs does not
28support them.
29\f
30
31Overall Babyl File Structure:
32
33 A Babyl file consists of a BABYL OPTIONS section followed by
340 or more message sections. The BABYL OPTIONS section starts
35with the line "BABYL OPTIONS:". Message sections start with
36Control-Underscore Control-L Newline. Each section ends
37with a Control-Underscore. (That is also the first character
38of the starter for the next section, if any.) Thus, a three
39message Babyl file looks like:
40
41BABYL OPTIONS:
42...the stuff within the Babyl Options section...
43^_^L
44...the stuff within the 1st message section...
45^_^L
46...the stuff within the 2nd message section...
47^_^L
48...the stuff within the last message section...
49^_
50
51 Babyl is tolerant about some whitespace at the end of the
52file -- the file may end with the final ^_ or it may have some
53whitespace, e.g. a newline, after it.
54\f
55
56The BABYL OPTIONS Section:
57
58 Each Babyl option is specified on one line (thus restricting
59string values these options can currently have). Values are
60either numbers or strings. The format is name, colon, and the
61value, with whitespace after the colon ignored, e.g.:
62
63Mail: ~/special-inbox
64
65 Unrecognized options are ignored.
66
67 Here are those options and the kind of values currently expected:
68
69 MAIL Filename, the input mail file for this
70 Babyl file. You may also use several file names
71 separated by commas.
72 Version Number. This should always be 5.
73 Labels String, list of labels, separated by commas.
74\f
75
76Message Sections:
77
78 A message section contains one message and information
79associated with it. The first line is the "status line", which
80contains a bit (0 or 1 character) saying whether the message has
81been reformed yet, and a list of the labels attached to this
82message. Certain labels, called basic labels, are built into
83Babyl in a fundamental way, and are separated in the status line
84for convenience of operation. For example, consider the status
85line:
86
871, answered,, zval, bug,
88
89 The 1 means this message has been reformed. This message is
90labeled "answered", "zval", and "bug". The first, "answered", is
91a basic label, and the other two are user labels. The basic
92labels come before the double-comma in the line. Each label is
93preceded by ", " and followed by ",". (The last basic label is
94in fact followed by ",,".) If this message had no labels at all,
95it would look like:
96
971,,
98
99 Or, if it had two basic labels, "answered" and "deleted", it
100would look like:
101
1021, answered, deleted,, zval, bug,
103
104 The & Label Babyl Message knows which are the basic labels.
105Currently they are: deleted, unseen, recent, and answered.
106
107 After the status line comes the original header if any.
108Following that is the EOOH line, which contains exactly the
109characters "*** EOOH ***" (which stands for "end of original
110header"). Note that the original header, if a network format
111header, includes the trailing newline. And finally, following the
112EOOH line is the visible message, header and text. For example,
113here is a complete message section, starting with the message
114starter, and ending with the terminator:
115
116^_^L
1171,, wordab, eccmacs,
118Date: 11 May 1982 21:40-EDT
119From: Eugene C. Ciccarelli <ECC at MIT-AI>
120Subject: notes
121To: ECC at MIT-AI
122
123*** EOOH ***
124Date: Tuesday, 11 May 1982 21:40-EDT
125From: Eugene C. Ciccarelli <ECC>
126To: ECC
127Re: notes
128
129Remember to pickup check at cashier's office, and deposit it
130soon. Pay rent.
131^_
132\f
133;;; Babyl File BNF:
134
135;;; Overall Babyl file structure:
136
137
138Babyl-File ::= Babyl-Options-Section (Message-Section)*
139
140
141;;; Babyl Options section:
142
143
144Babyl-Options-Section
145 ::= "BABYL OPTIONS:" newline (Babyl-Option)* Terminator
146
147Babyl-Option ::= Option-Name ":" Horiz-Whitespace BOptValue newline
148
149BOptValue ::= Number | 1-Line-String
150
151
152
153;;; Message section:
154
155
156Message-Section ::= Message-Starter Status-Line Orig-Header
157 EOOH-Line Message Terminator
158
159Message-Starter ::= "^L" newline
160
161Status-Line ::= Bit-Char "," (Basic-Label)* "," (User-Label)* newline
162
163Basic-Label ::= Space BLabel-Name ","
164
165User-Label ::= Space ULabel-Name ","
166
167EOOH-Line ::= "*** EOOH ***" newline
168
169Message ::= Visible-Header Message-Text
170
171
172;;; Utilities:
173
174Terminator ::= "^_"
175
176Horiz-Whitespace
177 ::= (Space | Tab)*
178
179Bit-Char ::= "0" | "1"