Trailing-Edge
-
PDP-10 Archives
-
mit_emacs_170_teco_1220
-
emacs/babyl.emacs
Click emacs/babyl.emacs to
see without markup as text/plain
There are no other files named babyl.emacs in the archive.
!* -*-TECO-*- *!
!*
The latest sources for Babyl are AI: EMACS1; BABYL > and AI: EMACS1; BABYLM >
on ITS, EMACS:BABYL.EMACS.0 and EMACS:BABYLM.EMACS.0 on Twenex. On
Twenex, you can just use the Compile command. On ITS, you should first
do an input translation from EMACS:*;* EMACS to AI:EMACS1;* > and an
output translation from EMACS:*;* EMACS to whereever you want the
compiled result to go (once upon a time this was KL: ECC; XBABYL :EJ).
If you don't like this, think of a better scheme that doesn't screw more
people than this one does.
The source for the installed EMACS; BABYL :EJ is either some BABYL nnn
(see the automatically-generated description of & SetUp Compressed
BABYL Libraries) or AI: ECC; BABYL SOURCE if patched. (Rare)
The source for the installed EMACS; BABYL' :EJ is some BABYL nnn or AI:
ECC; BABYL' SOURCE. (Rare)
Maintainers: Note that there are some conventions regarding documentation.
I (ECC) have a library that produces the INFO file command/variable
abstracts, that expects these conventions: First, use of SubDoc must come at
the end of documentation, and start out exactly alike, see an example.
Second, documentation may contain (anywhere) code to INSERT other
documentation. E.g. see documentation for |.
Modification history:
02/07/88 783 SRA Another typo, radix screwup labeling wrong msgs.
12/27/87 782 SRA Fix typo in & Autolabel TNX Bit Labels.
11/20/87 781 SRA Add support for preserving the hardwired (MM.MAC)
MAIL.TXT flags (Seen,Flagged,Answered,Deleted)
as Babyl labels. This is kinda slow, and it is
just barely possible that somebody is depending
on the old broken behavior, so this is turned off
by default. Set Babyl Convert TNX Flags To Labels
nonzero to enable.
8/24/87 780 SRA Merge XX and OZ versions back together again. Fix
Foner's version of M-X Compile that only works on OZ.
XX and OZ local changes were:
11/15/86 SRA [XX version 779] Make In-Reply-To code use
the Message-ID iff present (flakey).
1/09/86 SRA [XX version 778] Don't die in Survey One Message
if FL command fails.
10/07/85 SRA [XX version 777] Reimplement local changes that
were lost in Hurricane Gloria (local addresses
in Undigestify, Twenex M-X Compile command). Recompile
with new BABYLM (v164, does right thing for MMAILR),
fix R command so gets rid of extra deletes that
overzealous MMAILR code may add.
6/17/86 Foner [OZ version 774] Fixed local-modes so that Compile
works on OZ (only).
1/25/85 KMP [OZ version 773] The warning about locked mail file
which used to read
"... some other program, such as MM, ..."
was changed to read
"... another program, such as MM or the mailer, ..."
10/09/84 772 ECC Have F take string args when called as subr, and not
have parse errors be fatal. Change Babyl Reformation
Merges From/Reply-To to default 0, less confusing.
4/12/84 770 ECC ^T to show load average. Edit Labels List cleans up
,,s and makes CRLFs separate labels. Added pushes to
*Babyl* so can use M-X instead of (in addition to) X
in SvMenu: Label Labeled Messages, Delete Labeled
Messages, UnDelete Labeled Messages, Output Labeled
Messages, Label Message, Edit Labels List, and
Label Messages Containing String. Slight problem:
SvM doesnt know resurveying needs to be done.
***We still need to fix the bug about sorting, losing
bounds, and autolabeling.
01/05/84 765 KMP Added babyl options Expiration-Check-Interval
and Expiration-Check-Time. This should not affect
normal Babyl users but will be essential to ZBabyl
at some point.
11/30/83 764 KMP Make & Jump to Current Survey Line be much more
choosy about where it goes.
11/27/83 763 KMP Make & Babyl Set Mode Line do f[InsLen and f[SString
since it can go off at unpredictable times in the
middle of things which are relying on the default.
11/18/83 762 ECC Move trimming of BBOARD, SYSTEM, etc. out of & Setup
Reply Template as special cases to use vars. Also,
change & Babylize Buffer to handle either TNX or ITS
mail files on either system. Thus you can I to either
file on any system, for example. Fixed bug in & Form
Header, to not put space after colons in contin lines.
11/02/83 759 ECC Bump version number, since BabylM changed.
10/22/83 757 ECC Received: field flushed by default. ^S code cleaned
slightly -- :Ms and Ms made consistent, commented.
Clean up some documentation: ^C/^Z, ^X.
09/21/83 754 ECC Switching to use the new survey arg code. Consists of
deleteting the old survey functions, renaming the New
Survey.. functions to just Survey.., and deleting the
changeover helper Use New Survey Commands.
Changed default for Babyl Reformation Flushes These
Fields to be more conservative: no longer flushes
Redist.. and Keywords. Just low-level things.
08/06/83 752 ECC Extended Output Labeled Messages for use as subr.
06/26/83 750 SHSU Add # Babyl > and # Babyl < to get to end-begin of
current message. no :EJ file generated.
06/09/83 749 ECC Put in new survey arg code. For now, since
incompatible change, all replacement functions have
New... names, e.g. New # Babyl B. See & Setup... and
Use New Survey Commands function. In a few weeks or
so, after users have changed hooks etc., will fully
install these functions. More ITS 3F work.
06/08/83 745 ECC Worked on ITS 3F a bit.
06/06/83 744 ECC & Setup Reply Template made more robust when cannot
parse recipients. User can now continue, edit header.
05/26/83 742 ECC \ checks Fill Extra Space List. A revised so nA
doesn't iterate, printing survey headers etc. 3F
should now work on ITS (added :f6s). Labels list when
created will default to the semi-official default user
labels, e.g. RemindNow.
05/18/83 740 KRONJ Improve date reformatter.
04/14/83 739 ECC Fixed ^S prompting and ? bugs.
04/11/83 738 ECC Added Sam Hsu's ^W command.
04/10/83 737 ECC BabylM now calls Babyl Setup Hook, in its & Setup..
Noisy warning of unknown babyl options commented out,
for ZMail options. Reformation customizing extended
by adding Babyl Reformation Control and Babyl
Reformation Flushes These Fields; users can now
specify which fields appear, which dont. | can take
negative args, & Map Over Labeled Messages too. B
takes negative args. Survey Undeleted Messages added.
^SUx form added for Survey UN... R and F also query
for aborted mail.
03/09/83 734 ECC Remove OZ-hack in & Form Header, since XMAILR is now
taking care of USER@OZ, e.g. turning it into
USER%MIT-OZ@MIT-MC if it thinks it necessary. Changed
& Setup Reply Template so that Babyl CC To overrides
Babyl Dont Reply To, i.e. the auto-ccs are added after
pruning, if pruning is being done. Return-Path: not
shown in reformed headers. n^F and -n^F fixed to
search for the nth matching message. & Form Header
tries skipping leading day names in reforming dates.
02/12/83 729 SHSU Some cosmetic changes to In-reply-to: field; M will
confirm if last message aborted. REMAIL command on
3F. For TNX, set read date on mail file before renaming
so FINGER and MAICHK will work right.
12/20/82 728 ECC Changes to BABYLM to do minimal RFC822 support: uses
@ instead of "at" in outgoing headers, if multiple @s,
the earlier ones turn into %s. Still work to do:
1. If spaces in uname, make into a quoted string.
2. Header reformation might know about %s.
12/15/82 727 ECC Dummy message message prettified. Adding a x=y label
works (Label Message and & Add to Labels Option
changed). Reply setup fixed for no-From/Reply-to and
to not reply to System or Forum. ^F doc improved and
n^F iter removed as useless. Added Babyl O Confirm
New File.
12/01/82 725 ECC Moved insertion of in-reply-to out of & Setup Reply
Template and into its own subr, called AFTER editing
the mail, so user never sees it. # Babyl R now sets
the current template name to Standard Reply, as a
signal.
11/18/82 723 LNZ Change # Babyl ^O to use the Rcvd-Date: field
rather than the current date and time if the message
to be output has a Rcvd-Date: field.
11/18/82 722 GZ If Babyl Trim Recipient List is negative, do not do
*machine, INFO-xxx and BBOARD@ trimming, but still
do duplicate and Babyl Dont Reply To removal.
Also, fixed Undigestify to allow topic separator
lines to have up to 85 dashes.
11/14/82 721 LNZ If Babyl Suppress In-Reply-To exists and is non-zero,
do not generate an In-Reply-To field.
11/12/82 720 LNZ Fixed code for Babyl Keep TNX Received Date to properly
handle messages that don't end in CRLF.
EAK Added ~ command to GC.
10/14/82 717 ECC 0Y flusheds K-text. Shh (;) uses fsTYISource and
should be more general and intuitive now, not
dangerous -- changed: ; and exec, added & Babyl TYI
Source. & Bounds Of Header fixed to return good
bounds if null text field (should fix F, R, and H
problems).
NEW: Empty babyl files now handled fairly generally by
creating dummy messages in a few places: E, I, select,
& Initialize Babyl Buffer, & Reformed Bit, added &
Make Dummy Message.
9/12/82 716 Moon Make & Setup Reply Template put in In-reply-to field.
8/25/82 713-5 ECC Fix bug just introduced into reformer where it no
longer removed excess CRLFs and dashes at end. Also
improved it so as not to remove dashes at end of the
last text line, e.g. -Foo- type signature.
Changed & Parse Header and & Form Header so that
duplicate recipient fields (e.g. two separate From
fields) get merged with a separating comma. All
variable declarations for recipient fields, e.g.
From:, have comments starting with a comma. Also, &
Form Header now indents multiple Date lines nicely.
^T wont error if function not found. Have Create
Babyl File send its messages to something other than
BUG-BABYL, so if we want we can redirect them.
Add Babyl Variables Reset variable, so & Reset Babyl
Options and others can tell the exec to reset qregs.
8/22/82 708-12 ECC & Form Header OZ-hack changed to use MC, not AI, since
AI is not reliable. Fix & Bounds Of Header and &
Reform Header re messages with no text field --
extra-CRLF removal was removing the terminating blank
line and the original header therefore wasnt including
it. Broke 1H and F in cases where 1H had been done,
at least.
7/18/82 704-7 ECC arg^L keeps window. Add Babyl Reformation Merges
From/Reply-To, so people can disable just this if they
find its change-of-meaning effect on survey From field
unacceptable. Fix D, U to not 1u..h unless is typeout.
7/15/82 697-3 ECC Finishing touches: Fix return-value bugs in L, | --
when aborted they left the Babyl arg around. Have
label completer use Return/Linefeed distinction --
Return completes, Linefeed is for exactly what typed,
e.g. new label. Label abbrevs work in unlabelling. E
protects itself more when 0 messages left. Create..
asks whether to send message re INFO-BABYL. Answered
is now a basic label, compatible with ZMail. Label
reading for several commands allows new ones.
Surveyor fixed to not expect FW to always work.
Put unseen-handling into standard code, no longer in
the Babyl Command Hook. Have default R Done hook
label answered, since now a basic label. Unseen
handling now done in code, not Babyl Command Hook.
User can still override it, though slightly trickier.
But our handling is better now than was.
Fix Os check of Append -- past space before number.
7/14/82 695-6 ECC Extend Owner to allow several. & Reset Babyl Options
translates from list to just one. <ENTRY> separated
from Babyl, for documentation purposes. Further fix
mode line check of buffer. Add Babyl Two Window
Survey Menu. Split creator into two commands: Create
Babyl File, and Edit Babyl Options. Change & Babyl
Survey One Message so that Babyl Survey FROM/TO
Control can also be a macro, to tailor survey a bit.
Improve documentation for several commands. Note
BABYLM additions for init/vars processing, templates.
7/12/82 693-4 ECC Have T remove Unseen label, especially for SvM.
Have & SvMenu ^RNormal Macro and SvM T reform headers.
Change default Babyl Command Hook to remove unseen
after SvM T command, and only remove unseen in
exec if no typeout or typeahead.
Fix & Form Header bug re @ vs. at.
7/11/82 692 KRONJ Add parens to reply-to funny-char list (again).
7/08/82 690-1 ECC Added babyl reply-to field variable, used in F, M, R.
# Babyl G handles mail from old crash now, making two
passes. Fixed comments about what the argument to
Babyl G Done Hook is, what & Initialize Babyl Buffer
returns. Not # new, but # of last new message. G
keeps point and window if no new mail.
7/08/82 688-9 ECC Special reformation to handle BABYLM changes for
MIT-OZ -- sending from OZ gives Sender: User at
MIT-OZ, but From: User at MIT-AI, so is legal Arpanet
and can be replied to. Yet reformation hack allows
Oz-to-Oz messages not to look ugly and lets them reply
directly without going through AI.
7/05/82 685-7 ECC Finishing touches to this release: 1G handles any
kind of mail file on TNX or ITS, fix mode line
routine to handle empty file (e.g. called while
creating), 1G arg to & Read Filename. Refill some
documentation so will fit in info file when indented.
Fix incredibly dumb, disastrous bug in new version
control, to only set fsDVersion on TNX. Also fix
some wrong args to TNX & Read Filename. Make & Babyl
Execute Options check for empty file and quit.
7/04/82 683-84 ECC Fixed & Push Message re fsWindow being B-relative.
Change & Babyl Set Mode Line so last "label" means
last undeleted message. See if slows down too much.
On OZ it is fine... Perhaps option?
More version work: be sure is TNX-robust, by having
file opened to [TECO].OUTPUT, then renamed when close.
This for writing over versions. Changed: Create..,
Output Labeled.., O, G, and see BABYLM.
6/28/82 675-82 ECC Add Babyl File Version -- changed: I, Output
Labeled Messages, # Babyl O, Create Babyl File, & Read
Babyl File. Have 1G handle ITS mail/rmail files on
TNX, so people can FTP them over and merge them in.
Fix bug in Create.. so gives mail files correct
structure. Auto-N after D now tries P if cannot N if
option is -1.
6/27/82 673-4 ECC Output Labeled Messages changed to have O collect
messages in a buffer, with OLM reading/writing and
running done-hook, and to offer to unlabel.
6/27/82 672 ECC F command doesnt insert Babyl CC/FCC To variables.
Babyl O Filename can be a buffer, causing O to collect
messages in there, not writing each time.
6/22/82 671 ECC Answering no to new-label confirm goes back to read
label. Lets user then type <Alt><CR>.
6/21/82 670 ECC Also, change End (C-Alt) into Return instead of Q at
top-level. (Q is bad if type two Ends instead of one,
exiting mail edit.)
6/20/82 669 ECC Fixed & Add to Labels Option to use @FO, fixing new
label Z not being added if ZZZ existed. Label
completer can handle new labels now. May be
controversial -- Lpre<CR> wont complete to
Lprefix<CR>. It takes pre as new. Now you must
Lpre<alt><cr>. Abbrevs can get around this though.
6/20/82 668 ECC Play with KMP's filler a bit, e.g. to handle Undoing
last fill if needed. Fix & Babyl Set Mode Line QNS
bug, & Read Babyl File to protect against errors in
Create Babyl File. Add Babyl O Message Hook.
6/20/82 667 KMP Experimental change to ^R Fill Indented Mail Region
so that with an arg it can grok indented paragraphs.
6/02/82 665 KRONJ Fix Edit Labels List to not leave blank
Labels option. Zap from of self in SvM.
5/21/82 664 KRONJ Don't merge Reply-to into From if Reply-to
contains special chars (comma, angle brackets).
4/21/82 663 LNZ Fixed & Setup Reply Template to properly handle the
case of Babyl CC To being nonzero. (zu5 was located
before the insertion of this name rather than after.)
4/18/82 662 LNZ Fixed looping bug where Label Messages Containing
String expected # Babyl ^F to error at end of file.
4/16/82 661 LNZ Added Babyl Keep TNX Received Date to control
adding a Rcvd-Date header line with the TNX received
date and time (in & ITSify TNX Mail).
4/14/82 660 LNZ Fixed # Babyl O to correctly handle all three forms of
Append option (Append:<number>, Append, or nothing).
4/14/82 659 KRONJ Don't produce blank From: fields
4/12/82 658 LNZ Fixed # babyl O UTC Error.
4/12/82 657 LNZ Added Before Babylizing File Hook and fixed O
command to obey Append option of output file.
3/15/82 656 EAK Added Babyl Default File for KRONJ.
3/05/82 655 KRONJ Flush superfluous Reply-to: and Sender: headers,
merge Reply-to: into From: field when possible in
message reformation.
3/04/82 654 Chiron Fixed Babyl reply command to not flush Babyl FCC To.
1/16/82 653 ECC Various small changes suggested lately: add Babyl FCC
To for TNX, more care about Mail-From line for getting
host, new name Re-Enter Babyl for apropos use.
11/14/81 651 ECC Changing "badHeader" to "bad-header".
9/14/81 649 ECC Do (BUG foo) and comment removal first in & Babyl
Survey One Message so comment contents, e.g. commas,
wont confuse later processing.
8/18/81 648 KRONJ Abbreviate Stanford host names in SvM.
8/12/81 647 EAK Remove TNX code to force Babyl files to be version 1.
8/09/81 646 KMP Fixed & ITSify TNX Mail to allow for TNX message
length counts pointing past end of buffer. Some
mailers like to pad last word with nulls which TECO
treats as not there.
7/30/81 645 ECC H works better for bad headers: user can edit the
visible header and then H. H will no longer complain
about the lack of original header -- thus also ok to H
if original header discarded.
7/28/81 644 KRONJ Turn off auto fill mode within Edit Labels List.
Fix bug in # Babyl U where it wasn't catching the
lack of anything to undelete.
5/29/81 642 ECC Fix Babyl/ZMail incompatibility: ZMail puts ^L<CRLF>
at end of Babyl files, and we werent trimming it
properly. Copied the code that does it to & Read
Babyl File, in addition to # Babyl G where it used to
be. (Probably ought to just be in one place, e.g. the
babylizer.) This should fix totalmsg# bugs, and NIBs
when appending new mail.
4/07/81 639 Moon Fix handling of BABYL Append Option so that things
default reasonably, and add appropriate questions to
the babyl-file-creation dialogue.
4/04/81 638 ECC & Babyl Set Mode Line only resets ..J if changed.
Mode line thus wont redisplay unless has changed.
Babyl G Done Hook does not get run if no-argument G
finds no MAIL option, but & Initialize Babyl Buffer
does get run since I needs it.
3/28/81 636 KRONJ If there's no ^_ at end-of-file Babyl will still warn
but will insert it if continued.
3/27/81 635 ECC Babyl G Done Hook now gets #messages argument, counted
by & Initialize Babyl Buffer. Rechecked URK handling
to never assume an URK cannot happen when consing or
inserting, but instead make it more failsoft.
Generalized Moon's useful change, e.g. to allow
reverse for appenders too (e.g. if mailer prepends
to their mail file) or for prependers to choose not.
3/26/81 633 Moon When reading new mail, in Prepend mode, put the
messages in the correct order. Handle ..H correctly
in the command loop so that survey typeout gets
replaced by message display at the right time.
3/25/81 631 ECC Made reforming URK-failsoft. Made the resurveyor use
the same 1st-text-line heuristic as the surveyor, and
fixed a couple of minor bugs in the resurveyor (q5 not
pushed, not always set). Moved F, V, R, and & Setup
Reply Template into BABYL from BABYLM to make latter
smaller; not needed there.
2/22/81 626 ECC Added low-level mechanism for quiet surveys -- the
Survey Quietly variable. Changed one command to use
it -- # Babyl '. (Will hold all during that survey
menu invocation.) Renamed all *Brief*s to *Survey*s.
2/22/81 625 ECC ^S K changed to ^S L. Fixed up T and Space -- were
all garbled from antiquity. E.g. Space wont reshow
header, will end with CRLF. T does header/200char
check properly. The SvM T changed: T types all of
message, nT just part of text (-nT header); in 2w, T
uses OTHER window, does so generally (EMACS switching,
so other window commands will work), nT displays just
text. Survey Menu binds window variables and uses
Babyl Command Hook so user can bind things. Default
value for Babyl Command Hook is code, now that IVORY
fixed to allow Altmodes in there.
2/20/81 622 ECC Y sets Babyl Modified Messages, resurveyor tells ^R of
changes more precisely for better redisplay, SvM
fs^RNormal doesnt let Select Buffer set fsModeChange
(though this should soon be unnecessary when & Set
Mode Line has f=..J check), added 0K, K uses & Push
Message, Y and K ensure blank lines between killed
messages.
2/18/81 617 ECC Fixed I<cr> bug not using default Babyl file. (Fix is
to have # Babyl S f[DFile.)
2/12/81 613 ECC \ uses argument or Fill Column, not screen width.
2/10/81 612 ECC Changed expunger algorithm to be two pass. Old way
was one pass but used a S...... which is 10 TIMES
SLOWER... Also changed status line hackers to not
touch fsWindow, since virtual buffer no longer
includes status line.
2/04/81 610 ECC & Babyl Survey Several Messages no longers uses &
Maybe Flush Output, instead checking itself. Better,
since it will stop if user types Rubout. Sets
fsFlushed though, so others higher can use the
subroutine for convenience; fsFlushed reset to 0 in
command loop. Should stop the bug of
alternating survey line / Flushed when user types a
Space or Rubout ahead. Added Babyl Command Hook.
G allows multiple mail filenames in Mail option, but
currently only uses the first. Will later iterate
over them. This lets ZMail start using them.
1/30/81 606 ECC # Babyl I should be more robust: it marks buffer read
only until all babylization and conversion is done,
and only then may mark buffer writable.
1/27/81 601 ECC Made all dispatch table functions have documentation
class "C#". Changed the Babyl Helper accordingly.
Documentation now checks SubDoc to see if should
print information about subroutine use. Processes
active documentation. & Read Babyl File can ask for
another filename. See MC:ECC;BABSTR for command to
insert command, option, and variable abstracts, e.g.
for INFO file update.
1/17/81 580 ECC Putting in the Version 5 stuff from now-empty BABYLV,
to with standardized version-converting routines.
598 Terminology change: "key", "keyword" to "label", etc.
with several functions renamed for this.
Status bits now are basic labels, except reformed bit.
See & Convert Babyl File Version for format details.
Some new label routines. New basic label "recent".
G and O now may perform version conversion. More
robust G -- no leaving partial conversion or
babylization. See its comment. Message attribute
variables gone (e.g. Message Seen). Selector now just
bounds. E should be twice as fast since corrects
message# variables without another pass over file.
Line count in survey was +1, corrected. Quicker mode
line, no cache. O works on any bounds now, and
unlabels deleted and adds recent. ^S K not changed,
but maybe ought.
12/19/80 578 ECC Routines emptying *Brief* empty Babyl Modified
Messages since none to resurvey. It gets quite long.
Virtual bounds now just around the visible message,
not including old header or status line. No routine
should rely on whether bounds are set to get to status
line. Should make spurious display of EOOH etc
unlikely, improve use of two window operations, make
things safer and simpler for ^R command and X commands
that act on buffer, and prepare for day when Babyl
command loop disappears in favor of a Babyl mode.
Yanker changed in BABYLM to work with this.
12/14/80 575 ECC & Parse Header takes pre-comma numarg telling it not
to give error message about bad headers, but just
-1fsErrThrow so that the reformer can just mark it
and let the mode line tell the user about it. And
leaves point at top so EOOH line doesnt show. Other
callers though (e.g. R, F...) want the error message.
Also changed "Can't grok header" to more
understandable "Bad header -- not ITS nor NET style"
and "Bad header -- no colon in field".
12/08/80 573 GZ Changed & Babylize Digest Contents to not add a
"To:List-name" field if it is already there, and
to clean up any blanks/tabs on the "empty" line
separating the header from the message. Also
changed the use of some temporary q-regs so it will
be possible to have different host names for various
lists. Changed default host to MC, since SPACE is
not available at AI.
11/30/80 570 ECC Merged KEYSET and SVMENU sources into BABYL, since
they do not change frequently anymore and will thus
simplify bookkeeping (and my directory). Here is
KEYSET history:
6/20 JP Under advisement from ECC, changed labeller to keep track of
changed messages for the (SvMenu) resurveyor.
4/19 EC Changed to use keyword-reading with completion, with
keyword-abbrevs added and old crufty number defaults removed.
Added Undelete Keyset, changed | to use any keyset, added
Label Key Set. Made mapper not recalculate message#s since
that has awful paging behavior. Added Label Messages
Containing String.
... Random changes over time... (lazy history keeping)
9/?? EC Added and rearranged mapping stuff.
8/26 EC Remind Me Of This Message takes negative argument to forget
message, fixed to start from next message correctly.
RemindNow is automatically declared a valid keyword. The
default filename for Output Key Set is made from the keyword.
Originated in the dark prehistoric days of late Spring 1979 or early
Summer of said-same year. Worked on considerably in July and released
to the world of Babyl on 12 August.
Here is the SVMENU history:
Oct JP Changed to make use of fs^RNormal for intercepting printing
characters and interpreting them as Babyl commands.
7/4 ECC Born under colored patches of sky on 4 July, 1979. Worked on
considerably in late July and early August and released to the
world of Babyl on 12 August. After that, survey stuff
reworked to use real buffer and survey mode, use whatever last
survey was; T command changed and R added. Changed (along
with main-line Babyl) to keep track of altered messaged, and
to resurvey them. T command now tries to be clever with 2
windows.
11/15/80 568 KMP Fixed ^R Fill Indented Mail Region which was making
certain indented lines lose their indentation without
due cause.
11/09/80 564 ECC Added Gail Zacharias's M-x Undigestify Babyl Message,
& Babylize Digest Contents, & Find Digest Dash
Separator, and the option Undigestify Keep Digest.
11/08/80 563 ECC Merged in Kent Pitman's VBabyl extensions and
modifications:
Extended F (see BABYLM), added pre-comma argument to
M-x Babyl for DDT-run (^X exits to DDT if so), added
^R Fill Indented Mail Region, & Estimate Mail-Line
Category, \, Tab. & Read Babyl File offers to create
a non-existant file. So M-x Babyl<cr> can create.
Fixed Create Babyl File messages, adding safe answers.
& Babyl Execute Options has fs^REnter reset to a nice
mode line macro, and ^R command does 1fsModeChange.
M-X Fill Mail Text is gone -- newer one is better.
10/02/80 536 JP Purged Babyl Abort Message in favor of throwing the
error message. Changed command lookup function.
Installed fs^RNormal hack in SvMenu. Installed hack
(by ECC) where if G gets a numeric argument, it will
prompt for a filename. Can grab system mail (ITS/20X)
as well as other Babyl files. Tweaked the
documentation a bit, plus some function names, so that
the help facility will work better. Fixed the bug
that crashes Babyl if the XMail file doesn't exist.
Installed the infamous missing-host heristic into the
header reformer.
8/24/80 532 ECC Swapped names of ^F and F commands, so finder is now
^F and forwarder F. Removed recipient-adders and
yanker to move them into BABYLM.
7/17/80 526 ECC Create Babyl File will ask if want mail file, so TNX
users can say no -- they cant rubout-abort filenames.
# Babyl I and # Babyl E check if no messages, asking
user to either Q or I something else. Thus I think we
should now be able to have empty Babyl files without
trouble. D's N-after-D won't print message if no next
undeleted message. (N and ^N take 1, NUMARG.)
6/20/80 514 JP Fixed parser to recognize Re: as synonym for Subject:.
6/20/80 513 JP Installed various hacks of ECC's: Surveyor now takes
an option variable to limit the amount of effort it
will expend. New SvMenu hack keeps track of all
messages which have been munged -- when a survey is
reentered, modified messages are resurveyed in order
to keep the survey up to date. Also, & Initialize
Babyl Buffer now flushes the survey.
6/11/80 511 ECC & Parse Header takes NUMARG telling about the
message, and won't reparse if possible. # Babyl T
and # Babyl R no longer uses ancient parser. R now
uses & Parse Header. & Initialize Babyl Buffer will
force reparsing. The ancient parser, & Babyl Parse
Header is gone. See at the end of this history the
large comment discussing Babyl parsing.
6/11/80 510 ECC & Setup BabylM Library will set up Babyl ..D, thus
avoiding problems with calling & Process Recipient,
which expects it to be around. Also added local
variable Compile Command so can use M-X Compile.
6/10/80 509 ECC Changed _BABYL _TEMP file to be [BABYL <xuname>, in
order to avoid to avoid conflicts between users
sharing a directory. This will eventually be changed
again to avoid an intermediate file -- instead doing a
"transaction processing" approach, with the mail file
locked until the Babyl file is written. Also fixed
bug in # Babyl G that caused the Babyl file written
then (appending) to not have a good format: no
^L<CRLF> or ^_ at the end. This is probably the
causes of all those strange crashes where there was no
^_ at the right place -- someone had quit out of Babyl
without # Babyl Q or # Babyl S, and thus the Babyl
file written by # Babyl G was the one left. (Normally
the others clobber it to the correct format file.)
5/21/80 503 ECC Moved Create Babyl File into here from BabylV, since I
want that library to only be sources of converters
and then only the out-of-date ones -- a history. The
creator should ask some questions about options.
5/15/80 501 ECC ^R Babyl Yank has better window control -- won't go
to 1 window unless was Babyl in top, mail in bottom.
Similarly, # Babyl R will allow 2 windows to already
be in use, and just use the current window. Several
mail-sending routines removed to the BABYLM library.
It now needs to be compressed in with this, along with
KEYSET and SVMENU.
4/26/80 497 ECC Changed # Babyl ^S prompting to work with new EMACS
prompting scheme, especially on printing tty.
Also added Babyl-Command-Abort catch and replaced
several fsERRs with throws to this. These are
"user mistakes", not internal errors. Added fsXMods.
4/20/80 466 ECC Removed old keyword validation declarations, since
KEYSET now uses new completion scheme. Removed & Read
And Set Default that L used to use. Added Babyl
Keywords Option.
4/17/80 493 ECC Added Survey Unlabelled Messages. Needs a little more
work, but mostly will benefit in efficiency from a
restructuring of the surveying routines.
4/14/80 490 EAK FCC now appends directly to a TNX mail file.
4/11/80 489 ECC Removed autoloading stuff for KEYSET and SVMENU,
since they are now to be compressed in.
4/09/80 488 EAK Added Fcc: to & TNX Mail, and ^O command.
3/03/80 472 EAK Removed FR before @V.
2/27/80 470 ECC Renamed & Babyl Survey to & Babyl Survey Several
Messages to avoid naming conflicts being a prefix.
Added Babyl G Done Hook, though it needs more
work, concerning what conventions are, what state
should be before and after etc. Made mode line
display before message. Added Babyl Setup Hook.
1/09/80 464 ECC Added Babyl File Consistent flag, which is
bound to 0 locally by & Babylize Buffer. & Read
Babyl File resets it locally to 0 before reading in
file, and then to 1 when done. Note that killing
the *Babyl* buffer will allow a new MM Babyl (it
checkes if *Babyl* is empty), but doing MM Babyl on
a non-empty *Babyl* which is marked inconsistent
will err.
12/07/79 461 ECC Added cheap forward command (^F). Made & Babyl
Parse Header set up its own ..D.
10/29/79 454 EAK Random cleanup.
10/03/79 439 ECC Changed format of modification history. Don't you
wish you knew what it used to be?
10/03/79 438 EAK Changed Q and S to use Write File. Finished
simplifying R's help.
9/29/79 ECC Removed R's Submode stuff -- awaiting better, more
general help. Maybe should keep just [Mail] as
submode? Simplified R since TMACS now doesn't have
help or abort -- Babyl alone provides that.
9/23/79 ECC Added Submode help message to R, added ^S command,
made F show its argument.
9/19/79 ECC & TNX Mail Buffer copies message into a temporary
buffer before editing it. Original stays same, e.g.
for resending.
9/18/79 ECC Added Babyl R Done Hook and Babyl O Done Hook,
e.g. for autolabelling messages "answered" or
"filed". Added Abort Babyl Mail Edit and Babyl R
Help Macro.
9/13/79 EAK Added K and Y commands. Added 1R.
9/06/79 ECC Continuing Catch Errors change: ^G is not rebound
by Babyl, and fsNoQuit is set to 0.
9/03/79 ECC Changed to use new TMACS Catch Errors and have
fs^REnter bind it to 0 so errors don't exit modes.
8/15/79 ECC Worked on the survey commands: fixed up the unseen
handling to work with version 4. Spurious "Done"s
not printed by Survey Messages Containing String, B
prints "Done" or "Flushed". B takes pre-comma
NUMARG for not-emptying survey 1st and
not-typing-as-go. 0B just prints the label. &
Create Brief Variables is gone, replaced by &
Declare... & Push Message doesnt smash qregs 0 and
1 now. ? command takes "*" instead of "?" to
document all commands. Survey Messages.. works on
the starting message too now. ' autoloads SVMENU.
8/12/79 ECC Changed ? command to automatically generate its output.
8/04/79 ECC Put & Babyl Get Message Keys into Babyl, from KEYSET.
Changed & Process Recipient Field to uppercase host
names in the recipient buffer, for TNX mailer. Made
most subroutine descriptions one-liners, with a
comment following so that Babyl takes less pure space.
8/03/79 EAK,ECC Added & Process Recipient Field, used by & TNX Mail
Buffer and hopefully soon by lots of others -- is a
pretty fair RFC733 recipient field parser.
8/02/79 EAK Fixed & Complete TNX Header - it wasn't narrowing
the bounds to just the header.
8/01/79 ECC (And EAK a few days ago) Getting BABYL' ready for
installation. KEYSET loaded by L, |. Optional auto
labelling from subject fields. Cacheing used in
mode line setting. Status setting checks more
carefully that it is setting status bits, instead of
just bfing.
Bastille Day ECC Removed ..P to go into TMACS, changed to use & Declare
Load-Time Defaults, & Setup ensures that TMACS is
loaded.
7/10/79 EAK Removed EOOH subroutines in a few places to restore
reasonable functionality (if you can get the proper
functionality with them then go ahead). Removed
blank line after ITS headers, and fixed bug in & Form
Header that deleted whitespace at beginning of message.
Fixed bug where things that begin with MSG: are
considered ITS messages. Things still need work.
7/04/79 ECC Isolated EOOH handling into few subroutines, and
changed Babylization to start out by inserting EOOH
lines, simplifying other routines. In addition,
after Babylization, there is always a blank line
after the header, even for ITS headers. Added
routines for finding bounds of original and reformed
headers. & Reform no longer creates and kills its
variables each time -- I put that into the & setup,
in order to speed up reformation. The rest of the
changes were largely to help make Babyl more robust,
modular.
7/03/79 ECC Merged Tenex/Twenex SEND-MAIL library into Babyl, so
that the reply command works on ITS, Tenex, and
Twenex now.
6/30/79 ECC & Form Header trims away keywords in subject line, and
added & Push Message, new ..P, and Fill Mail Text.
Main command loop uses new ..p errset mechanism.
4/30/79 ECC O can take 1, argument.
3/21/79 EAK Added No Original option.
3/18/79 EAK Removed Comment:s, added REPLY-TO.
3/06/79 ECC Only set options if not exist already.
3/05/79 ECC Add key-display support, in B and & Babyl Set Mode Line
2/27/79 ECC Fix bugs and add minor features before doing major
keyset and survey- work.
< 2/79 EAK,ECC Ancient history beyond all recall... back in the days
when people were apes and Babyl was RMail.
*!
!~FILENAME~:! !Mail subsystem!
BABYL
!& SetUp BABYL Library:! !S Create option variables, call setup hook.
If the variable Babyl Setup Hook is non0 it is called at the end of Babyl's
setup, each time Babyl or BabylM is loaded.!
m(m.m& Declare Load-Time Defaults)
SubDoc,
If non0, command documentation mentions subroutine use: 0
Babyl Setup Hook,
If non0, is run immediately after loading Babyl library: 0
!* & Setup BabylM Library will call the setup hook.!
!<ENTRY>:! !S Mail file editor subsystem.
Same as the Babyl and Re-Enter Babyl commands.!
!* Separate just so that it does not appear in the automatically produced INFO!
!* section concerning commands.!
f:m(m.mBabyl) !* Turn into the other command.!
!Babyl:! !Re-Enter Babyl:! !C Mail file editor subsystem.
String argument is Babyl filename. It defaults, and can be
overriden. Describe the I command for details.
If Babyl was temporarily exited before, this command will re-enter it
instead of starting a new session. The # Babyl ^X command is
the one that temporarily exits Babyl.
DOC
.(g(m.m~DOC~ Process Babyl Init or Vars File)
-:sSubDoc"l 0:l 2r .,zk)j kCOD
qSubDoc"n i
A pre-comma numeric argument means this should exit back to DDT or EXEC.
Remembers this in Babyl Standalone Job (non0 if exiting to DDT).'!
m(m.m& Declare Load-Time Defaults)
Babyl Standalone Job, Non0 means will exit to DDT/EXEC: 0
m(m.m& Push to Buffer)*Babyl* !* Select BABYLs own buffer.!
1f[^RMore !* use --MORE-- in mode line!
fsZ"e !* If buffer is new!
m(m.mText Mode) !* initialize its mode!
1f<!Non-Empty!
1f<!Babyl-Catch! !* I may call Q which throws.!
:i*,m(m.m# Babyl I) !* Read BABYL file!
f;Non-Empty > !* If I ok, can continue.!
> !* But if empty, exit.!
' !* ...!
"# @ftReentering temporarily exited Babyl...
0fsEchoActivew !* Remind user not new file.!
f*' !* Ignore but require a string!
!* argument for compatibility.!
"'nuBabyl Standalone Job !* Remember whether should exit back!
!* to DDT directly, not EMACS.!
fs^RMode"n :m(m.m& Babyl Execute Options)'
!* Babyl expects to be inside a ^R. If that isnt so, we must call
a ^R, after arranging for the ^R to call & Babyl Execute Options.
*!
@:i*| f]^REnter !* Reset to old fs^REnter now that!
!* we are in mode. See below for!
!* where fs^REnter is pushed.!
m(m.m& Babyl Execute Options) !* call command processor!
fs^RExit !* exit stupid ^R mode!
| f[^REnter !* push fs^REnter to reset once!
!* inside mode.!
!* Enter and call Babyl!
!Edit Babyl Options:! !C Lets user change options for current Babyl file.
Will ask you about each of the various Babyl options that a Babyl file
may have.
This command should only be called from within Babyl.
qSubDoc"n iPre-comma numarg means called by creator: dont check buffer,
and dont print message about [..].!
[U[Y [1[2[3[4[5[6[7[8[9 f[DFile
fsXUName:f6uU !* U: Uname!
1f[FNamSyntax !* Lone filename becomes fn1 without!
!* changing fn2.!
m.m& Yes or NouY !* Y: Asks yes (-1) or no. (0)!
"e !* Unless called from creator, check.!
.u1 !* 1: Original point.!
f~Buffer Name*Babyl*"n !* Check correct buffer.!
oBadFile' !* ...!
0,(fsZ)fsBoundw j :f f~BABYL OPTIONS:"n oBadFile' !* ...!
:s
"e !BadFile! q1j !* No good Babyl file.!
:i*Edit Babyl Options must be used within BabylfsErr' !* ...!
q1j !* Restore point, so message push uses!
!* it. hmm...!
!* Restore point etc. carefully when done all this resetting: !
m(m.m& Push Message)' !* ...!
@fn|m(m.m& Reset Babyl Options)| !* And reset variables too.!
j s
0l b,.fsBoundw !* Bound to just BABYL OPTIONS.!
!* Qregs 1-7 will collect the new options. Reset now to old values, so!
!* can use as defaults. Use values in buffer, for sureness. Could use!
!* variables, but at least Babyl Owner Option is not the same -- trimmed!
!* to one if this user is in an owner list. Note that at the moment, not!
!* all these old values are used as defaults. The others are Yes/No!
!* questions anyway, so easy to answer.!
1f[BothCase !* Case-independence in option names.!
j 0u1 :s
XMail:"l @f l :x1' !* 1: 0 or XMail filename.!
j 0u2 :s
Mail:"l @f l :x2' !* 2: 0 or Mail filename.!
j 0u5 :s
Owner:"l @f l :x5' !* 5: 0 or owner string.!
!* Ask for the new options: !
ff&2"e !* Caller might already have printed.!
ftTypical (and safe) answers to questions will be shown inside brackets,
as in: [Y].
'
q2"n et2' !* Try old mail option as default,!
"# etDSK: fsHSnamefsDSNamew !* or default to users directory.!
fsOSTecof"ew etU MAIL' !* ITS mail file.!
"#-1"e etMAIL.TXT.1' !* TWENEX mail file.!
"# etMESSAGE.TXT;1''' !* TENEX mail file.!
0u2 !* 2: 0 if no mail file.!
ftIs there an incoming-mail file [Y]? mY"n !* ...!
1m(m.m& Read Filename)Mail filenameu2' !* 2: 0 or mail filename.!
q2"n et2 fsDFileu2' !* 2: 0 or full mail filename.!
0u4 !* 4: accumulates Babyl Append Option.!
ftDo you want new mail to be appended to the end (rather than inserted
at the beginning) of the Babyl file [Y]? mY"n 1u4 ' !* 4: append.!
1u8 !* 8: will be non0 if mailer appends.!
q2"n !* If the Babyl file has an incoming-mail file, then find out whether!
!* new mail needs to be reversed or not: !
fsOSTeco"e !* ITS, where user can tell the mailer!
!* either to append or prepend to the!
!* mail file.!
ftDo you tell Comsat (R-OPTION APPEND) [N]? mY"e 0u8'' !* 8: prepends!
q4-q8"e !* If do same thing (append/prepend)!
!* to both mail and Babyl file,!
!* messages are ordered.!
ftDo you want the incoming new mail reversed (this will make it
inconsistent with the BABYL file though) [N]? ' !* Prompt.!
"# ftDo you want the incoming new mail reversed (to be consistent
with the BABYL file) [Y]? ' !* Prompt.!
mY"n q4+2u4'' !* 4: add in whether should reverse.!
q1"n et1' !* Use old XMail as default, if one,!
"# etXMAIL.TXT' !* or use standard default.!
0u1 0u3 !* 1,3: 0 or XMail, XMail Append opts.!
q2"n fsOSTeco"n !* On TNX dont have mailing lists, so!
!* see if wants to fake one.!
ftDo you want an XMail file, which gets copies of all incoming mail as it
is added to the Babyl file [N]?
mY"n m(m.m& Read Filename)XMail filenamef"nu1 !* yes.!
et1 fsDFileu1 !* 1: XMail filename.!
ftDo you want mail appended to the XMail file [Y]?
mY"n 1u3''''' !* End of XMail option hacking.!
q5f"ew qu'u8 !* 8: Default owner spec.!
0u5 !* 5: Will be 0 or owner string.!
ftIs there an owner for this Babyl file [Y]? mY"n !* yes.!
1,m(m.m& Read Line)Owner user name (8): f"nu5 !* 5: Owner.!
fq5"e q8u5''' !* 5: If user typed CR, default owner.!
ftHeader can be reformatted to look better and not show redundant or useless
fields, and missing host names will be added so other commands will work
better, e.g. the reply and forward commands.
Do you want headers to be reformed [Y]?
mY"e 1u6 0u7' !* 6: No Reformation option.!
"# 0u6 !* 6: 0 means DO reformation.!
0u7 !* 7: No Original, default 0.!
ftIn general the old headers are saved, so the 1H command can show them.
Should original headers be discarded [N]? mY"N 1u7'' !* 7: No original.!
!* Now that we have picked up all the options we can set them. (Dont want to!
!* set as go, since if user aborts with ^G, then some options would be reset,!
!* some not.)!
j :s
Mail:"l 0lk' !* Default is for no mail file.!
q2"n jl iMail: 2
' !* Put in Mail option if one, at top!
!* since is important. Not matter.!
j :s
Append"l 0lk' !* Remove old Append option.!
jl iAppend: q4\ i
!* Insert new Append option.!
j :s
XMail:"l 0lk' !* Default is for no XMail.!
q1"n zj iXMail: 1
' !* Insert new XMail if one.!
j :s
XMail Append"l 0lk' !* Default is for no XMail Ap..!
q1"n q3"n zj iXMail Append
'' !* Put in XMail Append if one.!
j :s
Owner:"l 0lk' !* Default is for no owner.!
q5"n jl iOwner: 5
' !* Put in Owner if one.!
j :s
No Reformation"l 0lk' !* Default is for reformation.!
q6"n zj iNo Reformation
' !* Maybe turn off reformation.!
j :s
No Original"l 0lk' !* Defult is to keep originals.!
q7"n zj iNo Original
' !* Discard them if desired.!
0u..h !* Dont leave typeout on screen.!
!* Not a real abort, since 0 causes no message. But forces & Babyl Execute!
!* Options to reset its qregs to pick up new option values: !
0f;Babyl-Command-Abort
!Create Babyl File:! !C Create a new Babyl file, with sample message.
Will ask you for the Babyl filename, or you can give it as a string
argument. With a standard default for a user's main Babyl file
that reads the user's mail file. Will ask you about each of the
various Babyl options that a Babyl file may have.
Offers to send a message to BABYL-REQUEST@MIT-MC, requesting that
you be added to INFO-BABYL@MIT-MC.
qSubDoc"n i
The filename may be passed as a pre-comma argument.'!
m(m.m& Declare Load-Time Defaults)
Babyl File Version, * 0: read max version, write back to same;
1: read and write version 1, similar for other positive N;
-1: read max version, write back to next version
This only applies to Tenex or Tops-20 systems.: 0
[H[U[V[Y[1[2 0[3 f[DFile "e :i3 fq3"e 0u3'' !* 3: 0 or filename!
fsXUName:f6uU !* U: Uname!
1:<fsMachine:f6uh>"n 0uh' !* H: Hostname or 0.!
fsOSTeco"e :ihMIT-h' !* H: Change AI, e.g., to MIT-AI.!
qBabyl File Versionuv !* V: Version spec.!
e[e\ fne^e]' !* Push I/O.!
1f[FNamSyntax !* Lone filename becomes fn1 without!
!* changing fn2.!
m.m& Yes or NouY !* Y: Asks yes (-1) or no. (0)!
etDSK: fsHSnamefsDSNamew !* Default to users directory.!
etU BABYL !* Default Babyl filename.!
fsOSTeco"n qv"g qv'"# 0'fsDVersionw' !* Set version to 0 or N.!
f"ew q3f"ew 1m(m.m& Read Filename)Babyl filenamef"ew'''u3
!* I think overwriting max is correct, even for Create -- not to mention the!
!* soon-to-be Edit Babyl Options: !
et3 fsOSTeco"n fsDVersion"e !* TNX user didnt say particular N.!
qv"e !* If overwriting max, find N.!
1u1 1:<er fsIFVersionu1 ec>w q1fsDVersionw' !* ...!
"# qv"g qvfsDVersionw'''' !* Or set it from version spec.!
fsDFileu3 !* 3: Babyl filename.!
ftCreating Babyl file 3.
Typical (and safe) answers to questions will be shown inside brackets,
as in: [Y].
!* Clobber check only necessary on ITS (no version) or if specific version!
!* being used: !
fsDVersion"n oCLOBCHK' !* Specific version mentioned.!
fsOSTeco"e !CLOBCHK! !* Check on ITS no matter what...!
e?"e ftClobber existing 3 [N]?
mY"e ftAborted. 0''' !* ...!
!* Will build a basic Babyl file in a temporary buffer, then call Edit!
!* Babyl Options to let user specify the options.!
f[BBind !* Temporary buffer.!
iBABYL OPTIONS:
Version:5
0, recent, unseen,,
*** EOOH ***
Date: fsDATEfsFDConvertw i
From: BABYL at qh"n gh'"# iHere' i
To: U at qh"n gh'"# iHere' i
Subject: New Babyl file
This is a sample message in the new Babyl file.
Feel free to delete it.
1f<!Babyl-Command-Abort! !* To catch throw from Edit Babyl!
!* Options.!
1,m(m.mEdit Babyl Options) !* Let user reset the options.!
>w !* ...!
0,(fsZ)fsBoundw !* Widen bounds to whole buffer.!
et3 !* Set Babyl filename.!
f[DFile et[TECO] OUTPUT fsOSTeco"n 0fsDVersionw' !* On TNX, open to!
ei !* a safe file.!
f]DFile hpef !* Write out the file.!
fsOFileu1 @ft
Written: 1
0fsEchoActivew !* Tell user.!
qh"n ftWould you like mail sent to BABYL-REQUEST@MIT-MC, requesting
that U@H be added to the INFO-BABYL@MIT-MC
mailing list? mY"e ' !* No.!
hk !* Yes, clear way for message.!
iFrom: U at H
Sender: Babyl
To: BABYL-REQUEST at MIT-MC
Re: INFO-BABYL
gBabyl Header/Text Separator i
Please add U@H to INFO-BABYL.
1:< fsOSTeco"e m(m.m& ITS Mail Buffer)' !* Send it off.!
"# m(m.m& TNX Mail Buffer)'
>"n ftCould not mail the request.' !* If we can...!
!^R Fill Indented Mail Region:! !^R Fill Region being smart about indentation.
Fills region something like ^R Fill Region, but will keep
indentation and will not touch mail header or mail separator (e.g.
dashes) lines.
In particular, this is good for filling an indented message yanked
into a *Mail* buffer by the ^R Babyl Yank command. It will
respect indentation within the indented text too -- e.g. if the
yanked message contains within it another yanked message, etc.
Will also check for an ITS-header subject and put it on its own line,
in case the subject is very long and might be too long for the
screen width.
M-x Undo<cr> will bring back the old text, in case filling caused more
problems than it is worth.
With an explicit arg, this will try a different algorithm which may be
useful for filling messages with indented paragraphs, but which
will probably lose on some included messages.!
[0[1[2[3[4[5[6[7[8[9[.0[.1[.2
qFill Extra Space Listu.2 !* .2: Chars that want 2 spaces.!
[Fill Column qFill Columnu6 !* 6: Fill Column.!
f[VB f[VZ !* Save virtual bounds.!
m.m^R Back to Indentationu3 !* 3: Moves past indentation.!
m.m^R Delete Horizontal Spaceu4 !* 4: Deletes whitespace.!
m.m& Estimate Mail-Line Categoryu5 !* 5: Mail header detector.!
m.m^R Fill Regionu8 !* 8: ...!
m.m^R Indent Rigidlyu9 !* 9: ...!
!* Before saving for our Undo, see if we should first Undo an immediately!
!* preceding mail-fill. This typically happens when the user used the!
!* default mail-filling, noticed that it fouled up paragraph indentation!
!* lines, and decides to mail-fill again, this time specifying the other!
!* method. We have to Undo first, since otherwise those paragraph!
!* indentation lines wont get merged back together, and will look like!
!* separate paragraphs, leaving the user with no improvement whatsoever.!
.,(:)f u1u0 !* 0,1: sorted region points.!
q:..u(0!*buf!)-q..o"e !* Same buffer as previous Undo,!
q:..u(2!*start!)-q0"e !* same starting point,!
q:..u(3!*end!)-(fsZ-q1)"e !* same ending point,!
f~:..u(4!*desc!)message-fill"e !* and same description.!
!* All that rules out the easy cases of different. However, we!
!* still have to ask the user. E.g. inside mail edit, fills the!
!* whole message. Sends it off. Now another mail edit, with same!
!* header, and filling the whole text part. Has the same start and!
!* end "points', so it looks the "same'.!
ftIs this the very same message you filled before? (I.e. are you
correcting an immediately preceding fill of this message, perhaps by
giving different argument or Fill Column this time?
If unsure, safest thing is to answer no.)
m(m.m& Yes or No)"n 1m(m.mUndo)w' 0u..h'''' !* ..H: Let redisplay.!
!* That should have reset Point and Mark, so we can use them below.!
.,(:)f fsBoundw !* Set buffer bounds to region.!
hm(m.m& Save for Undo)message-fill !* Make this command undoable.!
5*5fsQVector[..u @fn|q..ufsBKillw| !* Dont let ^R Fill Region mess up our!
!* undo qvector...sigh...!
j 0l .u0 !* Start at head of line, put in q0!
q0f(:\u0 fn0jw )u0 !* Come back here when done!
.( zj 0f "n !* Make file end in a newline!
i
' !* ...!
)j !* ...!
< .-z; 0l !* Loop from point to bottom!
m5"n l !<!>' !* Skip mail header/separator lines.!
:f "e l !<!>' !* Skip blank lines.!
!* Found a line which can be filled. Now merge this line and each!
!* successive line with the same indentation. (As long as that line is!
!* not a header or separator or blank line: !
@m3w !* Skip past indentation.!
fsSHPosu1 !* 1: offset from head of line!
@m4w !* Get rid of initial indentation!
0u.0 !* .0: flag saying if first time thru.!
< l m5:@; !* Next line. Exit if a header line.!
@m3 !* Skip past indentation.!
:f @; !* Exit if null line or at end.!
fsSHPosu.1 !* .1: Indentation for this line.!
q.1-q1"e !* Same indentation.!
0:k @m4w !* .0: So merge it with previous line.!
0,0af.2:"l i ' i !* Need 2 spaces if after some chars.!
1u.0 !<!>' !* .0: Not first time through. Now go!
!* check next line..!
q.0"e !* If first time through!
ff"n !* and if paragraph-option !
q.1-q1 f"l +9"g !* and indentation decreased 1-8!
-1l q1-q.1, i !* then reindent paragraph starter.!
l @m3w q.1u1 !* 1: Go back where we were, and reset!
!* current indentation for rest of!
!* paragraph.!
0:k @m4w i 1u.0 !<!>''w'' !* .0: and loop for more lines there.!
0; > !* Different indentation, so exit.!
!* The previous line is now one long merged line that can be filled and!
!* then reindented: !
0l .: -l !* Set the Region around that line.!
q6-q1uFill Column !* Account for indentation.!
@m8w !* Fill the merged lines.!
.-z( q1m9w )+zj !* Reindent them.!
> !* Go see if any more lines that can!
!* be filled.!
q0j !* Jump to top again.!
!* Now try to check for ITS header subjects and if long, put them on their!
!* own line. Will recognize one by seeing if a date-like thing is followed!
!* by Re: .!
< :s:: Re: ; .u7 !* 7: Point where subject starts.!
:l fsSHPos-q6"g !* Subject goes past fill column.!
q7j -4d i
Subject: !* Move subject to its own line.!
-l m3 fsSHPos(l), i' > !* Make indentation match.!
z: !* Set point after region altered.!
q0,z !* Return region changed.!
!& Estimate Mail-Line Category:! !S Categorize current line.
Return 0 if not mail-related,
1 if header line,
2 if separator line,
-1 if send header line.!
!* Heuristic, for use on mail text which might contain an embedded message.!
!* A comment about the heuristics determining whether a line is a header field!
!* line and the effectiveness of them: Some lines will be considered not!
!* mail-related (0) which really are, e.g. a two-word field name or a!
!* continuation line. But these will frequently be ok, at least for the!
!* command ^R Fill Indented Mail Region since if the two-word field name line!
!* is surrounded by lines which are correctly categorized, it will not be!
!* merged into them. Similarly continuation lines will be filled together but!
!* not merged into surrounding lines since their indentation will be!
!* different. Thus, for ^R Fill Indented Mail Region at least, the!
!* 0-categorization is generally not detrimental.!
!* Note also that the filling of code -- especially code where there is much!
!* variance in indentation such as lisp -- will tend to do the right thing!
!* since lines will so often occur at different indentation levels that they!
!* will not get merged. Other languages -- eg, Midas -- which do not vary!
!* indentation much, will come out totally screwy, but this would be too slow!
!* if it tried to check too much unless someone can find a good heuristic for!
!* identifying language regions quickly!
[0 0f[vbw f[vzw !* Open bounds above.!
!* First, ^_-related checks to protect the structural integrity of!
!* a Babyl file in case of uncontrolled (mistaken) filling.!
0l 0,1a-"e 2' !* Babyl file separator line.!
-4 f=
"e 2' !* Babyl file status line.!
1:fsBoundw !* Bind bounds to this line.!
qBabyl ..D[..d !* ..D: Use header syntax table.!
:g..du..d !* ..D: Make a copy of it.!
:*5:f..d !* ..D: Modify to make : a word!
!* delimiter.!
!* Maybe Babyl ..D should standardly have word syntax for skipping over field!
!* name???!
1:<fwl>"n j oLast' !* Maybe exit if past line end.!
(-1,1a-:)*(-1,1a-@)"e j 1' !* Look for @ or : after first word!
0l @f l !* Skip whitespace!
12 f=MESSAGE FROM"e j -1' !* Old style send header!
13 f=[MESSAGE FROM"e j -1' !* New style send header!
:f f~*** EOOH ***"e j 2' !* Call EOOH-line a separator.!
qBabyl Header/Text Separatoru0 !* 0: E.g. --Text follows...!
:f f~0"e j 2' !* This line is a separator.!
!Last! !* Come here before giving up!
@f l !* Past whitespace.!
:f "n @f-_l :f "e j 2'' !* If rest of line is dashes and!
!* underscores, call it a separator.!
j 0 !* Nothing special.!
!Undigestify Babyl Message:! !C Break up a digest into individual messages.
The digest is assumed to be the currently selected message. It will
be replaced by the series of messages which made up the digest. A
"To:List-name" field will be added to each message header, for
replying and visual identification of the source digest list.
The option variable Undigestify Keep Digest controls what happens to
the original digest. This variable can have several values:
0: digest is discarded
+n: digest is kept, before the individual messages
-n: digest is kept, after them
+1: digest is additionally marked Deleted
-1: same
If a precomma arg is given it is used instead of the value of the
variable.!
m(m.m& Declare Load-Time Defaults)
Undigestify Keep Digest,
* Describe M-x Undigestify Babyl Message for details on values: 0
[l[d
m(m.m& Bounds of Header)w !* Move to start of message.!
@f
l !* Move to first non-blank.!
.,(fb r).xl !* L:first word (list name).!
m.m& Find Digest Dash SeparatoruD !* D: Separator finder.!
65,85mD"e !* Find end of topics list.!
:i*Bad Digest formatFSErr' !* Not found - err out.!
f:m(m.m& Babylize Digest Contents) !* OK, so go undigestify.!
!& Find Digest Dash Separator:! !S Find a line of numarg1 to numarg2 dashes.
Blanks before end of line are ignored. We move past the found line if any.
Returns 0 for failure, -1 for success.!
f[SString [1 !* Save search default.!
,-:i1 !* 1: minimal separator string of!
!* dashes.!
0s
1 !* Set search default to line!
!* starting with minimal separator.!
f u1 !* 1: number of extra dashes allowed.!
< :s"e 0' !* Find line starting with separator.!
!* If none, exit failing.!
q1,z-.f : u1w !* 1: min(q1, #chars-left-in-buffer),!
!* to avoid NIB error in F^B below.!
q1 @f-l !* Move past extra separator chars,!
!* up to the number allowed.!
@f l !* Move to first non-blank character!
!* after those allowed dashes.!
.-(:l .)@; !* Exit if at end of line.!
> !* Else not it, loop.!
1l -1 !* Move to next line and exit!
!* successfully.!
!& Babylize Digest Contents:! !S Does the work.
Bounds must be around a digest and . must be just past Topics section
separator, before contents of the digest.
QL must contain list name of digest.
QD must hold & Find Digest Dash Separator.!
!* This routine will:
1. Save for Undo.
2. Check Undigestify Keep Digest as well as precomma arg and
do the right thing as described for M-x Undigestify Babyl Message.
3. Insert babyl-separators between messages past point.
4. Update Message Number,Parsed Message Number and Number of
Babyl Messages.
5. Flush the survey buffer, because message numbers changed.
6. Select the Topics section as the current message.!
m(m.m& Declare Load-Time Defaults)
Undigestify Keep Digest,
* Describe M-x Undigestify Babyl Message for details on values: 0
[0[1 [b[t
fsmachineu0
.-b[p !* P: offset of start of digest.!
qNumber of Babyl Messages[N !* N: Total # of messages before!
!* undigestifying.!
:itTo: l@0
!* T: To: list-name at host line.!
!* Use our real host fer gossake!
b,zm(m.m& Save for Undo)undigestify !* Make us undoable.!
!* Undo will work as long as no non-digest msgs are messed with however the!
!* message numbers will be really messed up... Need to do & Initialize Babyl!
!* Buffer to recover completely.!
!* No help for it I think -- cretinous undo facility in EMACS.. -- ECC!
ff&2"e !* Get option or numarg.!
qUndigestify Keep Digest' "# 'u1 !* 1: ... Keep digest?!
q1"n !* Non-0 means yes: !
hx0 bj g0 i
!* Make copy of entire message.!
%nw !* N: increment # of messages.!
q1 -1"e !* 1, or -1, so mark digest deleted.!
.(q1"l z' "# b'j !* Move to the appropriate copy.!
m(m.m& Add Basic Label)deletedw !* Delete it,!
)j' !* and restore point.!
q1"l 4r fsZ-.fsVZw' !* Negative - work on 1st copy.!
"# .fsVBw !* Otherwise work on 2nd copy.!
%Message Numberw'' !* so increment Q$Message Number$.!
b+qpj !* Go to start of messages.!
f[vb !* Save top of digest.!
fsbconsub !* B: temp buffer for parsing headers.!
f<!Msgs!
@f
L !* Move past any whitespace.!
.-z; !* Exit if no text.!
i
0, recent, unseen,,
*** EOOH ***
!* Insert Babyl message start text.!
%nw !* N: increment # of messages since we!
!* have just added a message.!
!* Babyl cannot hack non-empty blank lines as message header separators!
!* (something Rmail has no trouble with...). Since this often happens in!
!* digests, we try to correct such headers.!
.-21fsvb !* Narrow bounds to rest of msg.!
:fb@:+2"e !* If a non-ITS header!
:s
+1"l !* and if a line starting with a blank!
!* comes before any empty lines.!
@f l 13,1a-13"e !* If it is a blank line!
0k' !* kill the blanks.!
"# 0li
''' !* Else insert an empty line before it!
1:< 0m(m.m& Parse Header) !* Now let babyl parser try it.!
>"n !* If still not a good header!
j 2lit
' !* make To:listname line the header.!
"# qb[..o gTo: gCc: !* Else get recepients in temp buffer!
j :sl ( !* and search for list name.!
hk ]..o !* (all done with temp buffer)!
)"e !* If listname not among recepients!
j 3l gt'' !* insert it as 2nd line of header.!
< 27,33md"e f;Msgs' !* Find separator, exiting if not!
!* found.!
-:l.,(0l).@f (2l)@; > !* Make sure really separator.!
!* The line before it should be blank.!
> !* Else do it again.!
qbfsbkill !* Kill the temp buffer.!
qnuNumber of Babyl Messages !* Updated total # of messages from QN!
0uParsed Message Number !* Numbering changed, so don't rely on!
!* it.!
:iBabyl Modified Messages !* No messages to resurvey.!
fq*Survey* Buffer"g !* If non-empty survey buffer.!
q*Survey* Buffer[..o !* Select it.!
hk 0fsModifiedw 0fsXModifiedw !* Flush it since numbers changed.!
]..o ' !* And return to original buffer.!
f]vb j !* Go back to Topics section.!
:m(m.m& Babyl Select Message) !* And select it.!
!Shorten From Field For Hermes:! !C Only username.
Forces the From field to be just Username at Host, no personal name
part.
Nice for Hermes, so other people can see your subject line in a
survey, since Hermes doesn't truncate a long From field.!
fsOSTeco"e :i*Only intended for use on TNX fsErr'
z-.[1 !* 1: Original Z-.!
bj .,(i
).f !* Boundary condition.!
bj :s
From:"l 0lk'"# l' !* Kill old From if any.!
.,(iFrom: g(fsXUName:f6) i
).f !* Just username.!
j .,(@f
k).f !* Remove boundary condition.!
z-q1j 1 !* Back to original point.!
!# Babyl ^C:!
!# Babyl ^Z:! !C# (^C on ITS, ^Z on Tops-20) Return to DDT/EXEC temporarily.!
100000.fsExit
!# Babyl ^D:! !C# Delete message and move backward.!
-1,(f) :m(m.m# Babyl D)
!# Babyl ^F:! !C# Find and select message containing a specific string.
Given no numeric argument the search is forward, starting with the message
after the current one.
Given a positive argument, N, searches forward for the Nth message to
contain the string.
Given a negative argument, -N, the search is backward, starting with the
message before the current one, for the Nth message to contain the
string.
If no match is found, returns to current message.!
!*
Pre-comma NUMARG is string to search for. If no pre-comma NUMARG, uses & Read
Line to ask for it. We return -1 on success and zero on failure. Diagnostic
is only issued if no pre-comma argument (e.g. we prompted the user for the
search string). Otherwise, we just return.
!
m(m.m& Declare Load-Time Defaults)
Babyl F Default,: ||
[0[1[2
ff&2"n u0' !* 0: string passed as pre-comma.!
"# qBabyl F Defaultu1 !* 1: Default from last F.!
ff"n :\u2 :i22 '"# :i2' !* 2: Stringified NUMARG.!
1,m(m.m& Read Line)2Find (Default "1"): u0 !''!
!* 0: string read from user.!
fq0"l ' !* Give up if rubbed out!
fq0"n q0uBabyl F Default'"# q1u0' !* Null string => use default; else!
' !* it is new default.!
0f[vb 0f[vz .u1 @fn| q1j | !* save current state of things in!
!* case search fails!
f"ew 1',0f < !* Search for abs(N)th match.!
"l -':s !* Start at end/top of this message.!
"l -':s0"E !* Search for the string.!
ff&2"N 0' !* Not found -- exit quietly,!
:i*Not foundf;Babyl-Command-Abort' !* or not-so-quietly maybe.!
> !* ...!
]..N ]*w ]*w !* Throw away saved state.!
m(m.m& Babyl Select Message) !* set bounds around found message!
m(m.m& Calculate Message Number) !* Figure out where we ended up.!
ff&2"N -1'
!# Babyl ^H ~:!
!# Babyl <Backspace>:! !C# Move to previous screenfull.!
f @m(m.m^R Previous Screen)w
!# Babyl ^I ~:!
!# Babyl <Tab>:! !C# Reformat a losing message that contains ^J's, ^H's, etc.
Replace them with their visual counterparts...
^H deletes character before it,
^J inserts carriage return + whitespace
^M becomes CRLF.
This is undoable. (I.e. M-X Undo<cr> brings back old message.)!
[0[1
m(m.m& Bounds Of Header): jw !* Go to top of header.!
.u1 fnq1j !* 1: Auto-restoring point.!
.f[VB :s"l r'"# zj' fsZ-.f[VZ !* Bounds around message.!
hm(m.m& Save for Undo)character fix !* Make this command undoable.!
!* Convert LF to CRLF + whitespace: !
j <:s
; rd !* Delete stray linefeeds.!
fsHPosu0 !* 0: Current column. Not SHPos since!
!* wrapping should be handled as is!
!* visually.!
i
q0, i r > !* Put in CRLF, indentation.!
!* Backspaces delete themselves and previous character (unless at beginning!
!* of line): !
j <:s; 0f -1"g -2d'> !* ...!
!* Convert CRs to CRLFs: !
j < :s
; !* Find stray ^M.!
-d i
> !* Convert to CR LF.!
!# Babyl ^J ~:!
!# Babyl <Linefeed>:! !C# Jump to next unseen message.!
.[0[1 !* 0: Original point in case dont!
!* find anyone.!
m.m# Babyl ^N[N !* N: Next message mover.!
m.m& Check Message Label[C !* C: Label checker.!
qMessage Numberu1 !* In case we just happen to want to!
!* come back here.!
f<!Babyl-Command-Abort! 1mN MCunseen@:; >"E ' !* Go until unseen.!
!* If control gets here, then we are!
!* ..throwing up [sic].!
q1m(m.m# Babyl J) !* Go back to starting message.!
:i*No more unseen f;Babyl-Command-Abort !* Change diagnostic and propogate!
!* ..the throw.!
!# Babyl ^L:! !C# Clear screen. Given a numeric argument, keeps same window.!
ff&1"n fsWindow(f+)fsWindoww ' !* Keep same window.!
f+
!# Babyl ^M ~:!
!# Babyl <Return>:! !C# No-op, flushes argument, and goes to next line.!
!* & Babyl Execute Options has already echoed the return. So we simply!
!* get rid of the argument by returning no value -- returning a value!
!* means keep the argument that has accumulated in Q5.!
!# Babyl ^N:! !C# Move to next message, whether deleted or not.
If argument, n, goes to nth next.
qSubDoc"n i
1, NUMARG means dont print any error message (just throw quietly).
String precomma numarg is label to f;-throw to if fail.'!
-[1 [2 !* 1: Count messages moved past.!
!* 2: 0, 1, or f;-label.!
m.m& Babyl Select Message[S !* S: Message selector.!
< 0fsVZw !* Set wide bounds below.!
:s
; !* To next message if any.!
ms !* Select it.!
%Message Numberw !* Probably better to keep in loop so!
!* 1 case is best -- N does 1^N loop.!
%1; > !* 1: Count message, stop if done.!
q1"n ms !* Reset bounds, message status.!
q2fp"g f;2' !* Caller wants to catch this case.!
q2-1"n :i*Now at end, no next message '( !* Set error message if no 1,!
!* ..NUMARG.!
) f;Babyl-Command-Abort ' !* And throw out of here.!
!# Babyl ^O:! !C# Append current message to a TNX mail file.!
m(m.m& Declare Load-Time Defaults)
Babyl ^O Filename,: |FOO TXT|
FS Date[0 !* Use current date and time. !
0F[V B 0F[V Z .[2 -S C :SRcvd-Date:+1"E @F L
FS FD Convert F"G U0 '' Q2J ]2 F]V Z F]V B !* unless Rcvd-Date: is present. !
[1 qBabyl ^O Filenamef"ew'f[DFile !* Bind default filename to ^O!
!* default if one exists.!
5,fAdd message tou1 et1 !* 1: Get filename.!
fsDFileuBabyl ^O Filename' !* Remember altered filenames!
e[ e\ fn e^ e] !* Push i/o.!
!* Assumably the message has been selected, and therefore bound. If not, we!
!* wont err, but strange stuff could be appended to the file. Should we!
!* bound carefully?!
q..ou1 f[BBind !* 1: Original buffer, message.!
g1
:s
Re:
+1"e @f l 0k iSubject: ' !* change Re: to Subject: !
Q0:m(m.m& Append to TNX Mail File) !* append buffer to file!
!# Babyl ^P:! !C# Move to previous message, whether deleted or not.
If argument, n, moves to nth previous.!
-[1 !* 1: Count messages moved past.!
qMessage Number-1< !* don't go back too far!
0fsVBw !* Set wide bounds above.!
-:s; !* Back to end of previous message.!
1:<m(m.m& Babyl Select Message) !* Select that one!
>@:; !* Abort if error!
qMessage Number-1uMessage Number !* ...!
%1; > !* 1: Count message, stop if done.!
q1"n 1:< m(m.m& Babyl Select Message) !* Select that one!
>"n 1m(m.m# Babyl J)' !* If can.!
:i*Now at top, no previous message f;Babyl-Command-Abort' !* ...!
!# Babyl ^R:! !C# Enter a recursive edit level on current message.!
[0[1[2 [3[4 !* Temp registers.!
fsVB[3 fsVZ[4 !* Save prev bounds.!
1fsModeChangew 0f[^RMore !* Let user edit.!
qMessage Number:\u0 !* 0: Add message number to resurvey!
:fo..qBabyl Modified Messagesu2 !* ...list.!
q:..q(%2)u1 !* ...!
:i:..q(q2)10M0
!* ..!
fsVB-q3"E fsVZ-q4"E q3+q4"N ''' !* If bounds still same and narrow,!
!* ..assume only selected message was!
!* ..edited.!
m(m.m& Initialize Babyl Buffer) !* Otherwise, reset number variables.!
!# Babyl ^S:! !C# Survey-prefix. Also ignores ^S^Q for VT52 lossage etc.
^S^A or ^SA is M-X Survey All Messages
^S^D or ^SD is M-X Survey Deleted Messages
^SUD is M-X Survey Undeleted Messages
^S^L or ^SL is M-X Survey Labeled Messages (reads a label)
^SUL is M-X Survey Unlabeled Messages (reads a label)
^S^M or ^SM is M-X Survey Messages Containing String (reads a string)
^S^F of ^SF is --ditto--
^S^R or ^SR is M-X Survey Reminders
^SS is M-X Survey Seen Messages
^SUS is M-X Survey Unseen Messages
^S? shows this description and then reads another character.
To correct for stupid terminals, any number of ^S's followed by a ^Q
are ignored. This is for VT52s, H19s, maybe others.!
[1 0[2 !* 2: 0 if have not prompted.!
20:"e !* If no typing from user, prompt.!
1u2 !* 2: Remember that we prompted.!
:i*CfsEchoDisplay !* Clear prompt area.!
@ftKind of survey (A,D,L,M,R,S,UD,UL,US, or ?): ' !* ...!
< 2,m.i fi:fcu1 !* 1: Dispatch character.!
q1-:@; > !* Exit when not a ^S, thus we!
!* ignore ^S^S...^S^Q.!
(q1-177."'e)(q1-"'e)"n ' !* Exit quietly, no-op, if it was a!
!* rubout or ^Q.!
q1-32"l q1@u1' !* 1: Turn ^A to A, etc.!
q2"n @ft1' !* Extend the prompt.!
fsRGETTY"e ft
' !* New line if printing tty.!
q1-A"e !* ^S^A or ^SA.!
f:m(m.mSurvey All Messages)' !* ...!
q1-D"e !* ^S^D or ^SD.!
f:m(m.mSurvey Deleted Messages)' !* ...!
q1-L"e !* ^S^L or ^SL.!
!* Note that we cannot :M, since we need to pass a string arg: !
fm(m.mSurvey Labeled Messages) ' !* Null STRARG means it should!
!* use the reader to get!
!* label.!
(q1-M"'e)(q1-F"'e)"n !* ^S^M or ^SM or ^S^F or ^SF.!
f:m(m.mSurvey Messages Containing String)' !* ...!
q1-R"e !* ^S^R or ^SR.!
f:m(m.mSurvey Reminders)' !* ...!
q1-S"e !* ^SS (not ^S^S...)!
f:m(m.mSurvey Seen Messages)' !* ...!
q1-U"e !* ^S^U or ^SU. Another char follows.!
< q2"e 20:"e !* If no typing from user, prompt.!
1u2 !* 2: Remember that we prompted.!
:i*CfsEchoDisplay !* Clear prompt area.!
@ft^SU (D,L,S): '' !* ...!
2,m.i fi:fc@u1 !* 1: Uppercase char.!
q2"n @ft1' !* Extend the prompt.!
q1-D"e f:m(m.mSurvey Undeleted Messages)' !* ^SUD.!
q1-L"e f:m(m.mSurvey Unlabeled Messages)' !* ^SUL.!
q1-S"e f:m(m.mSurvey Unseen Messages)' !* ^SUS.!
1u2 fg @ft
^SU (D,L,S): >' !* 2: Help and repeat if illegal.!
q1-?"e m(m.mDescribe)# Babyl ^S !* ? gives help and then!
f:m(m.m# Babyl ^S)' !* reads another character.!
fg !* Illegal choice. Complain noisily.!
!# Babyl ^T:! !C# Call ^R Display Load Average, for TNX users.!
1,m.m^R Display Load Average[1 !* 1: Function or 0.!
q1"n @m1' !* Do it if can.!
"# fsOSTeco"n !* Else do it ourselves, if can.!
1:< fsLoadAvu1 !* 1: Load av string.!
:i*CfsEchoDisplayw !* Clear echo area.!
@ft(Load average = 1) !* Type message.!
0fsEchoActivew >w'' !* Keep it around.!
!# Babyl ^]:!
!# Babyl ^X:! !C# Temporarily exit Babyl. Doesn't file out.
Exits to EMACS or DDT/EXEC, depending on how Babyl was called:
If was 1,M-X Babyl or a BABYL job then will exit back to DDT/EXEC.
Repeating the M-X Babyl command will resume with state unchanged.!
m(m.m& Declare Load-Time Defaults)
Babyl Standalone Job, Non0 means will exit to DDT/EXEC: 0
:i*CfsEchoDisplayw !* Clear echo area.!
qBabyl Standalone Job"e f;Babyl-Catch' !* Exit to EMACS.!
100000.fsExitw !* Exit to DDT. When job is!
!* continued, exit back to Babyl.!
!# Babyl ^[ ~:!
!# Babyl <Altmode>:! !C# Execute a TECO command string.!
f@m(m.m^R Execute Minibuffer)w
!# Babyl ^V ~:!
!# Babyl ^` ~:!
!# Babyl <Space>:! !C# Print more of this message.
On printing terminal: prints rest of message.
On display terminal: goes to next screenful.
n<Space> scrolls up n lines.
9999 Space (or any semi-infinite numeric argument) goes to the
end of the message.!
fsRGETTY"n 1:<f @m(m.m^R Next Screen)>w ' !* Display, scroll.!
!* The errset is so passing a very!
!* large numeric argument will just go!
!* to the end without erring.!
ft
!* On printing tty, print!
ff"n .,(l).t !* As many lines as specified (maybe!
m(m.m& Babyl --MORE--)' !* then --MORE--).!
"# .,zt !* Or all the rest of the lines.!
zj -2 f=
"n ft
'' !* Supply a CRLF at end if need it.!
!# Babyl ^W:! !C# What is left of this message? Gives line/window count.!
!* The bounds are set around the current message. To calculate how many lines!
!* are left, we take the top line, go down size-of-window lines, and start!
!* counting from there.!
m(m.m& Declare Load-Time Defaults)
Next Screen Context Lines,:1
[0[1[2[3[4
.u0 fnq0j !* 0: Auto-restoring point.!
fsLinesf"ew !* If 0, have just one window.!
fsHeight-(fsEchoLines)-1( !* One window. -1 ignores mode line.!
)'u1 !* 1: Window size.!
fsWindow+bj !* To top of window.!
q0m(m.m& Count Screen Lines)+1u2 !* 2: Count, and include this line.!
!* @ftWindow size= q1@:= @ft Message lines= q2@:=!
:i*CfsEchoDisplayw !* Clear echo area.!
(q2-1)/q1u4 !* 4: how many screens left.!
q4"e @ftBottom of message. 0fsEchoActivew ' !* None.!
q2-q1u2 !* 2: lines not seen already.!
(q2-1)/(q1-qNext Screen Context Lines)+1u4 !* 4: How many screens,!
!* correcting for overlap.!
q2@:= @ft Line q2-1"g @fts'
@ft left in message @ft( q4@:= @ft screen
q4-1"g @fts' @ft).
0fsEchoActivew !* Keep printout there.!
!& Count Screen Lines:! !S Count number of physical screen lines from point.
Postcomma arg gives point to go back to.
Precomma arg means go backwards.!
0[0 !* count of lines!
[1 !* point to preserve!
@fn|q1j| !* point to return to when we exit!
ff&2"e !* given precomma arg?!
!* @ft Counting forwards!
< 1:<1,0:fm>"n 0;' !* go down one screen line!
%0 !* count it!
>
z-."e q0-1u0 ' !* EOB? not really another line!
'"#
!* @ft Counting backwards!
< 1:<-1,0@:fm>"n 0;' !* go up a screen line!
%0 !* count it!
>
'
q1j !* back to where we belong!
fn !* now safe to clear this!
0fsechoactive
q0 !* return our count!
!# Babyl ':! !C# Into recursive edit level on survey.
No arguments means use the last survey. If no last survey,
we call .
M,N arguments means survey messages M through N.
N argument means survey next N messages.
-'<character> is like ^S<character>' but does not print while
surveying. (Except for a "Done" which is unavoidable without
serious work.)
For more details, see documentation for M-X Survey Menu.!
!*
This is a separate function from Survey Menu to work better with the EMACS
documentation facilities.
!
m(m.m& Declare Load-Time Defaults)
Survey Quietly,:0
"l 2[Survey Quietly !* Force quiet survey.!
@m(m.m# Babyl ^S)' !* Do a survey.!
"# f':m(m.mSurvey Menu) !* Pass arguments if not -1.!
!# Babyl .:! !C# Return the message number of current message.
To reposition at top of current message, do .J!
qMessage Number:\[1 !* 1: no. as a string!
:i551 0 !* append to Q5, return something to!
!* say we have set Q5!
!# Babyl ;:! !C# Accumulate a line, then execute it with no display.!
m(m.m& Declare Load-Time Defaults)
Babyl Shh Text,: ||
!* Can sometime try to have more than one line accumulated...!
[..J :I..JBabyl-Shhh
m(m.m& Read Line);uBabyl Shh Text !* Save the text.!
m.m& Babyl TYI SourcefsTYISourcew !* Now FIs will read from this text.!
!& Babyl TYI Source:! !S Uses ;-generated text, sets fsReread.!
m(m.m& Declare Load-Time Defaults)
Babyl Shh Text,: ||
qBabyl Shh Text[3
fq3:"g 0fsTYISourcew 0' !* Done shh-rereading.!
0:g3fsReReadw !* Next FI gets this char.!
1,fq3:g3uBabyl Shh Text !* Remove that char.!
0
!# Babyl =:! !C# Type value of numeric argument.!
=
!# Babyl 0 ~:!
!# Babyl 1 ~:!
!# Babyl 2 ~:!
!# Babyl 3 ~:!
!# Babyl 4 ~:!
!# Babyl 5 ~:!
!# Babyl 6 ~:!
!# Babyl 7 ~:!
!# Babyl 8 ~:!
!# Babyl 9 ~:!
!# Babyl + ~:!
!# Babyl - ~:!
!# Babyl , ~:!
!# Babyl * ~:!
!# Babyl / ~:!
!# Babyl ) ~:!
!# Babyl ( ~:!
!# Babyl <Digit>, <Comma>, +, -, *, /, (, and ):!
!# Argument Part:! !C# Part of a Babyl numeric argument.!
!* The extra, final name there will cause Describe to use a reasonable name --!
!* without it, you can ask to have 5 described and be confused when it uses!
!* the name # Babyl (. It must be first alphabetically.!
:i550 0
!# Babyl A:! !C# Move to next message and summarize it.
Given an argument, moves forward that many undeleted messages, and
summarizes the intervening messages as well as the last one.
If the option variable Babyl A Mode Display is non-0, we will update
the mode line. (Default is to update it.)
Users on slow display terminals may want to disable updating, and use
an occasional Z= instead, to see how many messages there are.!
m(m.m& Declare Load-Time Defaults)
Babyl A Mode Display, * Non-0 lets A update mode line: 1
!* End of declare.!
qMessage Number[1[2 !* 1: Message# originally at.!
m(m.m# Babyl N) !* To next (nth) message.!
qMessage Numberu2 !* 2: Message# going to.!
qBabyl A Mode Display"n !* Update mode line if enabled.!
1fsModeChw fr' !* Display mode line since B will!
!* inhibit it.!
m(m.m& Push Message) !* Will come back here when done.!
!* ***Change this for new scheme -- simpler.!
q1+1m(m.m# Babyl J) !* To original+1 message.!
q2-q1m(m.m& Babyl Survey Several Messages) !* Survey intervening msgs.!
!* This includes last one but not the!
!* original message.!
!& Babyl Survey Several Messages:! !S survey next NUMARG2 msgs.
NUMARG1 has bits:
1, dont 1st empty survey buffer.
2, dont print as go. ORed with Survey Quietly.
0 NUMARG just makes a label.!
!* Leaves its summary in EMACS buffer *Survey*.!
!* Bits are used by higher level surveyor. E.g. dont-empty allows appending!
!* of several different surveys. Dont-print allows computing the survey, in!
!* *Survey*, without having to watch it. Good, e.g., for survey menu.!
m(m.m& Declare Load-Time Defaults)
Survey Quietly,:0
*Survey* Buffer,:0
[1[7[8[9 qSurvey Quietly[2 !* 2: 0 iff should print as go.!
qBabyl ..D[..d !* ..D: Be sure to use Babyl syntax,!
!* ignore any strange ..D user may have.!
.u7 @fn|0,fsZfsBoundw q7:j"e zj' m(m.m& Babyl Select Message)| [7[..o
!* Auto-restoring point.!
0fsVBw -s
l .fsVBw !* Put top at status line.!
-1f[Truncate !* do not continue, just excl overflow!
q..ou9 !* 9: mail buffer.!
q*Survey* Bufferu8 !* 8: 0 or summary buffer.!
q8fp"n !* If not a buffer, must create.!
[Previous Buffer !* Save default for ^XB.!
m(m.mSelect Buffer)*Survey* !* Create/select summary buffer.!
q..ou*Survey* Buffer !* Save buffer for quick access.!
q..ou8 !* 8: Summary buffer.!
m(m.mSelect Buffer)' !* Back to Babyl buffer. *!
q8u..o !* Select survey buffer.!
q2&1"e hk :iBabyl Modified Messages' !* Empty it if no 1, bit.!
!* This means none to resurvey.!
q9u..o !* select mail buffer!
fsZ-z"e :i*C fsEchoDisplayw @ftNo Messages
0fsEchoActivew q8u..o 0fsXModifiedw 0fsModifiedw '
qMessage Numberu7 !* 7: message no.!
m.m& Get Labels for Survey[K !* K: ditto.!
m.m& Babyl Survey One Message[X !* X: survey one message!
ff&1"e 1'"# q8u..o i No. Lines From->To Subject or Text
q2&2"e -t' !* Label if NUMARG given. Type it!
!* if no 2, bit.!
'< !* Iterate NUMARG or 1 times.!
q2&2"e fsListen"n :fi-32"n 1;''' !* Quit if non-Space typeahead. This!
!* includes stopping for Rubout,!
!* unlike using & Maybe Flush Output.!
!* More appropriate for surveys,!
!* unlike for --MORE--s.!
q9u..o j !* To message buffer.!
s
*** EOOH ***
2r .fsVBw !* Set bounds past original header.!
q8u..o 3,q7\ !* Put in message #.!
q9,q8mX !* survey message!
q2&2"e -t' !* and display our handiwork if no!
!* 2, bit.!
!DEL! !* Come here to skip delete message.!
q9u..o zj !* Prepare to move to next message.!
0,(fsZ)fsBoundw !* Widen bounds.!
4 f=
:@; !* Stop if no next message.!
%7w !* Else bump our temporary message no.!
l .,(sr). fsBoundw !* Bounds around next message.!
>
q2&2"e !* if no 2, bit say we are done!
fsListen"n :fi-32"n ftFlushed.
1fsFlushedw'' !* Be sure others stop, even if they!
!* use the standard & Maybe Flush!
!* Output which wouldnt otherwise stop!
!* if user types Rubout..!
"# -1"g ftDone.
''' !* Say done if could have done more!
!* than one message.!
q8u..o 0fsXModifiedw 0fsModifiedw !* Unmodify summary buffer.!
!& Babyl Survey One Message:! !S msgBuf,surveyBuf NUMARGs.
MsgBuf bound so starts with CRLF.!
!* CRLF start is for easier searching for header field names.!
m(m.m& Declare Load-Time Defaults)
Babyl Survey FROM/TO Control,
* Bits, 1 = enable prettification, 2 = shorten hosts, 4 = no hosts
Can also be a macro, which is given message, survey buffers as args.
Q1 gives point where from-to field starts in survey. It can update
that, e.g. if it wants to put something before the from-to area.
It should return number (bits as above).: 3
[0[1[2[3[4[5 [7
u..o !* Select message buffer.!
mku7u0 !* 7: User label list string.!
!* 0: Status character.!
-u1 <.-z;%1wl> !* 1: no. of lines in the message!
!* Note the -1 init since CRLF at top.!
u..o q0i 5,q1\ !* Insert status character, # lines.!
0u0 0u3 0u4 0u5 !* 0,3,4,5: initially no 1st lines,!
!* From:s, To:s, or Subject:s!
u..o jl !* beginning of 1st line of message!
4 f=MSG:"e l !* Skip over MSG: line if system msg!
< 8 f~DISTRIB:@:; !* DISTRIB: ?!
8c @f l 1:x4 l > !* treat DISTRIB: like To: !
< 8 f~EXPIRES:@:; l > !* skip over EXPIRES: lines!
' !* End of MSG:-handling!
1:fb@:f"ew u..o i ??? !* Cant grok header. Truncate survey.!
oCGM' +1"e !* ITS header!
:s "e u..o i ??? !* Cant grok header. Truncate survey.!
oCGM' r 0x3 !* 3: ITS From.!
:fb Re: "l 1:x5' !* 5: subject!
l 4 f~TO: "e 4c 1:x4 l' !* 4: To: line!
< 4 f~TO: @:; l> !* skip over To lines!
< 4 f~CC: @:; l> !* skip over cc lines!
0l .u0 !* 0: Point of first line.!
' !* end of ITS header conditional!
"# !* Network header!
:s
"l 2r .u0 !* 0: Point of first line!
!* (before actually).!
'"# zj' fsz-.f[vz !* set bounds around header!
j < :s
From; @f l 1a-:"n !<!>' !* find a From: line!
c @f l 1:x3 1; !* 3: the From field.!
>
j < :s
To; @f l 1a-:"n !<!>' !* find a To: line!
c @f l 1:x4 1; !* 4: the To field.!
>
j < :s
Subject
Re; @f l 1a-:"n !<!>' !* find a Subject: line!
c @f l 1:x5 1; !* 5: the subject field.!
>
f]vz !* restore bounds to whole message!
' !* end of header conditional!
u..o i .u1 q3"n g3' !<!i-> q4"n g4' !* < put in from->to!
!* Now we process the FROM and TO a little to prettify it if bit-1 of the!
!* control option is set. If from/to is a hook, it can reset q1 which!
!* specifies where from-to part starts.!
qBabyl Survey FROM/TO Control[9 !* 9: Control bits. This should be!
!* set by & Babyl Survey Several!
!* Messages actually.!
fq9"g ,m9+0u9' !* 9: If control is a macro, call it,!
!* and let it process first, then!
!* return to us the control bits.!
q9&1"n !* Prettification is enabled.!
!* First process ITS structured names of BUG form and comments. By!
!* processing comments first, they wont confuse later stuff -- e.g.!
!* there can be commas in the comments.!
q1j 0s(BUG !)! <:s; BUG- ful -d > !* Change (BUG FOO) to BUG-FOO.!
q1j < @:f(l!)! .-z; 1:<flk>"n:k' -@f k > !* Delete other!
!* comments.!
!* Find any RFC733 names (e.g. Foo Fah <FOOFAH at HOST>) and just keep!
!* the stuff inside the angle brackets -- the real username -- since it!
!* is probably briefer.!
q1j <[5 >[6 !* setup for loop!
< @f,-6l .u2 !* 2: Point where next fields name!
!* starts.!
@:f,65l .-z; !* To /\<....> or end of field. (The!
!* close bracket is there to catch!
!* arrows.)!
1a-q5"e !* We are at /\<....>.!
q2,.kd !* Kill name before <....> and kill the open!
!* bracket.!
@:f6l .-z; !* To <...../\>.!
d' !* Delete the close bracket. We are!
> !* now at the end of the field.!
!* (Usually -- if not, the next!
!* iteration will move us there.)!
q1j 0s, < :s; -d > !* Compress a bit.!
q9&4"n !* Show no host names at all.!
q1j 0s at @ <:s; fkc @:f,6f(l0,1a-q6"e-1')k>' !* ...!
"# q9&2"n !* Show no local host names and!
!* shorten some others..!
q1j 0s at < :s; @ > !* Canonicalize at to @.!
q1j 0s@MIT-Multics < :s; @MUL > !* shorten MIT-Multics!
q1j 0s@MIT- <:s; -4d > !* abbreviate MIT host names!
fsOSTeco"e q1j 0s@AI@MC@ML@DMS@DM <:s; fkd >'
!* Dont show ITSs if on one.!
"# q1j fsMachine:f6[2 0s@2 <:s; fkd > ]2'
!* Dont show own machine else.!
q1j 0s@SU-AI <:s; @SAIL > !* dont confuse SU-AI with MIT-AI.!
q1j 0s@SU- <:s; -3d> !* Shorten other Stanford sites.!
q1j 0s@USC-ISI <:s; -3c-4d > !* abbreviate ISI host names!
q1j 0s@CMU-10 <:s; -3D > !* abbreviate CMU host names.!
'' !* End of host shortening.!
fsXUname:f6u2 zj i !* Delete self.!
q1j fq2+2 f~2->"e fq2d' !* Special case for if we sent it!
!* (because dash isn't a delimiter).!
< r :s2; r -fq2d !* Zap our user name.!
1a-@"E <@:f,- k 1a--@:; q6,2a-q6@; d>'> !* Self at non-local!
!* ..host: zap host.!
]6]5 !* Clean up. Hmm... ugh.!
' !* End of prettification.!
!* Now work on the subject area: labels, subject, and/or 1st text line.!
zj -d 33-(fsHPos)f"l d'"# ,32i' !* Subject/labels start at column 34.!
i 7 !* Insert user label list string. It!
!* ends with a space if non-null.!
q5"e q0"n !* If no subject but have 1st line,!
u..o 0fsZw q0j !* go to Babyl buffer and 1st!
!* text line.!
!* Errset is so FW doesnt bomb if text is not really text: !
:<@f
l .-z; !* Past any whitespace.!
fw +1af@:-:; :l > !* Ignore line if 1st word!
!* ends in : - or @. (- there!
!* for things like mail-from.)!
.-z"e q0j @f
l' !* If heuristic obviously!
!* failed, dont use it.!
:x5 !* 5: And use 1st line instead of!
!* ..subject.!
u..o'' !* Back to brief buffer.!
q5"n g5' !* Insert subject/1stLine.!
0fsHPosition-(fsWidth-2)f"g,0 d i!'w !* Truncate the line.!
!CGM! !* come here if cannot grok message!
u..o i
!* end summary of this message!
!& Babyl Resurvey One Message:! !S Updates survey line.
Updates status char, length, labels, subject.
NUMARG is msg #. Buffer should be survey buf. This will be a
no-op if survey line not found.
Caller should bind:
K: & Get Labels for Survey
B: Babyl buffer
S: survey buffer
J: # Babyl J!
.[0[1[2[3[4[5 !* 0: old survey line point.!
3,:\u1 j:s
1"e q0j ' !* If not find message, quit.!
qB[..o mJ !* To babyl buffer, message.!
0fsVBw -s
l .fsVBw !* Rebound to include original header!
!* and status line.!
mku2u1 !* 1,2: Status character, labels.!
s
*** EOOH ***
!* At reformed header.!
.(0u3 <.-z;%3wl>)j !* 3: # lines in message.!
!* Both ITS- and network-header messages may start with MSG: fields: !
4 f=MSG:"e l !* Skip over MSG: line if system msg!
< 8 f~DISTRIB:@:; l > !* Skip over DISTRIB: lines.!
< 8 f~EXPIRES:@:; l >' !* Skip over EXPIRES: lines.!
!* Both clauses, for ITS and network header, will set q4 to the subject line!
!* or 0 if not found, and set q5 to the point where the 1st text line is.!
0u4 !* 4: No subject yet.!
1:fb@:f"ew !* Quit if cant grok header.!
'+1"e !* ITS header.!
:fb Re: "l 1:x4' l !* 4: subject.!
< 4 f~TO: @:; l> !* Skip over To lines.!
< 4 f~CC: @:; l> !* Skip over cc lines.!
0l .u5 !* 5: Start of 1st text line.!
' !* end of ITS header conditional!
"# !* Network header.!
:s
"e zj' .u5 !* 5: Start of 1st text line.!
< -:s
Subject
Re; !* Back to possible subject field.!
fkc @f l 1a-:"n 0l !<!>' !* Make sure it is a real one.!
c @f l :x4 1; > !* 4: the subject field.!
' !* End of header conditional.!
!* If we have no real subject line, we will use the first text line. But we!
!* try a heuristic to get a good 1st text line, skipping ones that appear to!
!* be embedded header lines, e.g. if the message starts out with a yanked!
!* message: !
q4"e q5j !* No subject -- go to text.!
< @f
l .-z; !* Past any whitespace to next line.!
fw +1af@:-:; :l > !* Ignore line if 1st word ends in : -!
!* or @. (- there for things like!
!* mail-from.)!
.-z"e q5j @f
l' !* If heuristic obviously failed, dont!
!* use it.!
:x4' !* 4: Now subject or 1st line.!
!* Now we have all the necessary stuff from the message: !
!* 1: status character, 2: null or {label list}, 3: # lines, 4: subject!
!* or 1st text line.!
!* We will check new status character, line count, and labels+subject against!
!* the old and carefully tell Teco what changed, so that redisplay will not!
!* have to retype the entire line.!
qSu..o 0l !* Back to survey buffer.!
4c 0a-q1"n -d q1i -1 f' !* Maybe reset the status character.!
@f l \-q3"n -5d 5,q3\ -5 f' !* Maybe reset line count.!
0,34:fm !* Move to column 34, where the!
!* labels+subject should be.!
!* Will compare label+subject together since usually have to move!
!* subject over by retyping if labels change anyway.!
:fx1 !* 1: Old labels+subject/text.!
.( g2 g4 !* Get labels and subject/text.!
0fsHPosition-(fsWidth-2)f"g,0 d i!'w !* Truncate the line.!
)j !* Back to start of labels.!
:f f=1f"nf"l*(-1)'cr :f f'w !* Tell Teco of any changes in labels!
!* + subject/text. Range starts at!
!* difference and goes to end of line.!
!# Babyl D:! !C# S Delete this message, maybe select next.
Given numeric argument, n, means delete message n.
The option variable Babyl N After D controls whether Babyl
automatically moves to another undeleted message after deleting
this one. Values are:
1: Try to do an automatic N -- move forward if can (default).
-1: Try an N (go forward), but if no next message, try a P (go
backward) instead.
0: No movement. You view the deleted message.
qSubDoc"n i
Pre-comma NUMARG is amount to N after this, e.g. -1 for the ^D
command.'!
m(m.m& Declare Load-Time Defaults)
Babyl N After D,
* 1 means N after a D, -1 means N or P, 0 means no movement: 1
!* End of declare.!
ff&1"n m(m.m# Babyl J)' !* Go to message NUMARG.!
m(m.m& Add Basic Label)deleted"n @ft
(Already deleted.) !* Department of Redundancy Department!
0fsEchoActivew' !* ...!
ff&1"n fsTypeout"g 1u..h'' !* Dont mess up possible brief.!
1f<!N-OR-P! !* Catch if N cant go to undeleted.!
ff&2"e !* No pre-comma NUMARG.!
qBabyl N After D"e ' !* Dont N.!
1'"# ',(:i*N-OR-P): m(m.m# Babyl N) !* Go show next!
!* undeleted message if one exists.!
!* The 1, (note NUMARGs switched by!
!* : ) doesnt let N print an error if!
!* we delete the last message.!
>w
qBabyl N After D"l 1m(m.m# Babyl P)' !* Maybe P if cannot N.!
!# Babyl E:! !C# Expunge deleted messages. Handles empty file.
If expunging leaves the file with no messages, a dummy message is
inserted, since many Babyl commands don't work without some
message in the file.!
m(m.m& Babyl Expunge) !* Expunge deleted messages.!
1m(m.m& Initialize Babyl Buffer) !* Reset things, though not message#s!
!* since those are ok.!
!* The initialize selected the current message. Or if expunging left none,!
!* it created a dummy message and selected that.!
!# Babyl F:! !C# Forward current message. You can edit the message.
The mail will be set up to include the current message and a subject
based on the original one if any. You can then edit any of this
before sending it off. Describe Edit and Mail Buffer for details.
If you give a numeric argument of 2 we will try to use 2 windows, with
the current message in the top and the message being sent in the
bottom one.
If you give a numeric argument of 3 we will REMAIL the message instead
of forwarding it. The variable Babyl Remail Control controls the
action of 1F: 0 (read TO: and send); non0 (read TO: then edit and
send). Babyl Remail Hook should be a TECO macro to run after message
is set up. (Sorry. No 2 window mode yet...someday, 4F will do this.)
The option variable Babyl F Control controls the default action of F:
0: You are put in a recursive edit level on the outgoing
message, which has an empty To: field (point is there), a
subject based on the original one, and the forwarded
message yanked into the text field. You can thus edit any
field and add comments. On terminals with insert/delete
line capability, we try to optimize redisplay.
1: The To: and Subject: are read in the echo area, and you
are then put in a recursive edit level on the outgoing
message, with the header above the screen window, i.e.
with only the text field showing. (This may be desirable
for users with slow terminals without insert/delete line
capability, or for users with printing terminals.) Typing
Rubout to the subject prompt makes the message not have
any subject; typing Return makes the default subject be
used.
2: Reads the To: and Subject: in the echo area, and then
mails the message, without entering a recursive edit
level.
1F or 2F will force the general default action -- i.e. as if Babyl F
Control were 0. (1F uses one window.)
After the message template is set up, runs any Teco program you
provide in the variable Babyl F Hook.
When successfully exited (not aborted) it will run any Teco program
you provide in the variable Babyl F Done Hook, passing it F's
arguments.!
m(m.m& Declare Load-Time Defaults)
From:,,:0
Subject:,:0
Babyl Reply-To Field, * Automatic Reply-To field in mail if non-0: 0
Babyl F Done Hook, 0 or a Teco program to run after F successfully exits: 0
Babyl F Hook, 0 or a Teco program to run after F sets up its template: 0
Babyl F Control,
* 0 (general edit), 1 (read To/Re then edit), 2 (read To/Re and send): 0
Babyl Remail Control,
* 0 (read To field and send), non0 (read To then edit): 0
Babyl Remail Hook, 0 or Teco program to run after message set up: 0
Babyl Header/Text Separator,
* 1 line that separates header and text in recursive mail edit:
|--Text follows this line--|
fsQPPtr[.0 [0[1[2[3[4[5[6[7[8[9 !* .0: Top level unwind point.!
!* If called as a subroutine, by M (not @M), then pick up To and Subject.!
!* Note that caller must provide both unconditionally.!
:f"g :i*( :i7 )u5' !* 5,7: To,Subj if M-called.!
-3u6 !* 6: controls whether doing remail.!
ff&1"n 0'"# qBabyl F Control'u2 !* 2: Controls reading, entering.!
:i*To continue editing this message use the C command.(
)[Abort Resumption Message !* For Abort Recursive Edit.!
.(1m(m.m& Parse Header)w)j !* Parse message, setting variables.!
!* Leave point where it was. The 1!
!* means we are parsing a numbered!
!* message.!
fsQPPtru9 !* 9: Unwind to here to reselect back!
!* to message buffer.!
-2"'e,1m(m.m& Push To Edit Mail) !* Use 2 windows if NUMARG=2 and reset!
!* buffer mode and filenames.!
fsModified"n !* Aborting leaves *Mail* modified .!
ft
Last message being composed seems to have been aborted.
Continue editing aborted message?
m(m.m& Yes or No)"n q.0fsQPUnwindw !* Yes, so pop buffer etc. and!
f@:m(m.m# Babyl C)'' !* become a C command.!
q6"e !* doing remail? !
hk
0fsWindoww
1,4@m(m.m^R Babyl Yank)w
j :s
"e zj'
.,z x3 !* 3: save msg text!
.,zk !* and leave header here!
j i
!* comment out some fields!
0s
To:
Cc:
Fcc: !* Set search default just once.!
j <:s; 0l iOrig-> !* Comment out some fields.!
fsOSTeco"e 0s
Sender:
Date: !* For ITS, COMSAT will put in some!
!* things anyway,!
j <:s; 0l iOrig->' !* so comment original ones.!
fsXUname:f6u6
fsMachine:f6u8
:i*6@8u8 !* default Sender!
zj -@f
k
i
fsOSTeco"n iReSent-From: g8 i
' !* Not on ITS -- COMSAT puts on sender!
q5u8 :f"l 1,m(m.m& Read Line)Remail to: f"ew 'u8' !* 8: To!
iReSent-To: g8 i
!* Unfortunately redun with TO on ITS,!
!* since COMSAT doesnt strip the BCC.!
!* But this emphasizes the remailing.!
fsOSTeco"n iReSent-Date: 212221000000.,fsDatefsFDConvertw i
' !* Just on TNX. On ITS, COMSAT will!
!* put in a DATE field.!
iBcc: g8 i
!* On ITS, this will show as TO, a!
!* COMSAT bug of sorts.!
qFrom:u8 q8"e :i8Unknown?
'
fsOSTeco"n j :s
Sender:"e jl iSender: g8'' !* On ITS, best not to bother?!
j @f
k !* Kill blank line at top.!
zj
gBabyl Header/Text Separator i
g3
qBabyl Remail Hookf"nu8 m8'w !* run hook if any.!
qBabyl Remail Control"n !* if wants edit, then!
'w !* let user see it first!
fsOSTeco"e m(m.m& ITS Mail Buffer)' !* Just mail, without any!
"# m(m.m& TNX Mail Buffer)' !* editing.!
0fsModifiedw 0fsXModifiedw !* mark success!
'"# !* begin FORWARD code!
!* Now set up the message template for editing. We will keep the same!
!* subject if any or make one.!
!* Set up To: field: !
hk iTo: .u3 !* 3: Point we may restore later.!
0fsWindoww !* Dont use any previous one.!
q2"g q5u1 :f"l 1,m(m.m& Read Line)To: f"ew 'u1' g1'
!* 1: Maybe read TO.!
i
!* End TO field.!
!* No use of Babyl CC To or Babyl Fcc To, since forwarding is a different!
!* idea, isnt outgoing message of this person, and since this user already!
!* has a copy of the message, so use of cc-to for that reason doesnt help.!
!* Hmm... strictly not true? -- e.g. if forward has a comment by this!
!* user? But, user can always add a CC if wants to.!
qBabyl Reply-To Fieldf"nu1 iReply-to: g1 i
'w !* Maybe insert Reply-to field.!
!* Set up Re: (subject) field: !
qFrom:u1 fq1"g !* There is a From to use.!
iRe: 1 !* Insert it for parsing.!
:i1??? !* 1: Uname, in case parse fails.!
fsQPPtr( fsBConsu4 @fn|q4fsBKill| !* 4: Temporary for parse.!
1:< :i*,q4m(m.m& Process Recipient Field)Re !* Parse.!
q4[..o j @:f@x1 >w !* 1: Username part of from.!
)fsQPUnwindw !* Back to message.!
0lk i[1: ' !* End of username part.!
"# i[???: ' !* Unknown from.!
qSubject:u1 fq1"g .(g1)j :l .,zk i]' !* Append original subject if!
!* one. But only 1 line.!
"# iforwarded]' !* Or make up something.!
0fx1 !* 1: The default subject, removed.!
q2"g q7u4 :f"l 1,m(m.m& Read Line)Re: (1): u4' !* 4: Subject.!
fq4"n q4u1'' !* 1: 0 or subject line.!
fq1"g iRe: 1
' !* Done subject field.!
gBabyl Header/Text Separator i
q2"g .u3' !* 3: Point we may restore.!
j 0u1 < .-z; %1w l > !* 1: number of lines being added.!
.fsWindoww !* This makes the @:f work.!
.( 1,4@m(m.m^R Babyl Yank)w !* Yank message to forward, without!
!* indenting it, and keep 2 windows if!
!* have them.!
)j q2"e q1@:f' !* Scroll down, if possible, by number!
!* of lines added. Only if showing!
!* new header.!
x1 !* 1: 1st line of yanked message.!
q3j !* Put point in TO or at top of text.!
qBabyl F Hookf"nu0 fm0'w !* Run F hook if any.!
q2-2"l m(m.mEdit and Mail Buffer)' !* Let user edit the mail and then!
!* mail it off.!
"# fsOSTeco"e m(m.m& ITS Mail Buffer)' !* Just mail, without any!
"# m(m.m& TNX Mail Buffer)'' !* editing.!
j :s
1"l fkc l .u1 0u0 j <l %0w .-q1;> !* 0,1: VPos,. for 1st message line.!
!* If can, scroll the yanked message back up to top screen line to!
!* optimize probably redisplay when go back to Babyl message!
!* display: !
fsTopLine+q0fs^RVPosw q1j q2"e 0@:f''
' !* end of remail conditional!
q9fsQPUnwindw !* Back to Babyl buffer for done hook.!
qBabyl F Done Hookf"nu1 m1'w !* Run any done hook.!
!# Babyl G:! !C# Get any new mail received since Babyl was started.
1G means get mail from another mail file. You will be asked for its
filename. Any kind of mail file can be read in (it figures out
which kind it is): ITS or TNX mail file, an RMail file, or
another Babyl file. The file will NOT be deleted -- you must do
this manually, if desired.
The Append option (at the top of the Babyl file) determines where the
new messages are put in the Babyl file and in what order:
0: prepend messages to beginning of Babyl file
1: append messages to end
2: prepend and reverse order of new messages
3: append and reverse
Reversal is only done for the primary mail file, for the owner.
When G is done, it will run any Teco code in the variable Babyl G Done
Hook. Argument is 0 if no new mail, or the number of the last new
message.
qSubDoc"n i
Pre-comma NUMARG of 1 means not a manual G -- called by I.'!
m(m.m& Declare Load-Time Defaults)
Babyl G Done Hook,
User hook, run (if non0) after new mail is collected;
argument is 0 or message# for last new message: 0
[1[2[3[4[5[6[7[8 f[DFile !* save!
"e .'"# -1'u7 fsWindowu8 !* 7,8: Original point, window, so!
!* manual G stays if no new mail. Or!
!* -1 if auto-G, meaning not to!
!* restore point.!
qBuffer Filenamesu3 !* Q3: buffer filenames!
qBabyl Mail Optionu2 !* 2: 0 (or n...), filename, or list.!
q2fp"g 0,(,f2f"lw fq2'):g2u2'"# 0u2' !* 2: 0 or filename.!
!* For now, ignore others in list.!
ff&1"e !* No argument, use mail option.!
q2"e m(m.m& Initialize Babyl Buffer)w ' !* Return if no mail option.!
!* Just initialize, no G done hook.!
et2 fsDFileu2 !* 2: full mail filename. Directory!
' !* now defaults to one with mail file.!
"# q2"n et2' !* Default to current mail file.!
4m(m.m& Read Filename)Mail filef"ew'u2 !* 2: Filename.!
et2 fsDFileu2 !* 2: Full mail filename.!
0u3' !* Make this a non-destructive read.!
!* Note that when done, just before the following cleanup, buffer bounds will!
!* be wide (B=0) iff we got NO new mail. If we did get new mail, the bounds!
!* are set around that new mail. (Even if all messages are new, the BABYL!
!* OPTIONS section will still be out of bounds, and thus B~=0). & Initialize!
!* Babyl Buffer will return the number of the last new message, which will be!
!* the total number (appending mail) or the number of new messages!
!* (prepending mail). The multiplication by B (0) or 1 translates this into!
!* 0 or that value. Because the bounds are wide or around new mail, the q7:j!
!* should restore point only if no new mail.!
@fn| q7:ju3 !* 3: -1 if able to restore point.!
bf"nw1'*(m(m.m& Initialize Babyl Buffer))u1 !* 1: 0 or last #.!
!* Note that a select just happend, putting point at the top of the!
!* message. So if our q7:j worked but was not at message top, we need!
!* to redo it: (the :J in case original point was meaningless, e.g. in!
!* Babyl Options).!
q3"l q7:j"l q8fsWindoww'' !* Restore point and window.!
qBabyl G Done Hookf"nu2 q1m2'w | !* Run Babyl G Done Hook.!
!REDO-G! !* Comes here for second round if!
!* picking up mail from crash.!
!* ***AFTER HERE DO NOT SMASH Q2 or Q3 -- they need to be the original values!
!* when we come back for the second round.!
0,fsZfsBoundw !* widen bounds!
!* Possible errors should come after user types 1G string arg so user will be!
!* able to type ? to error if it happens: !
qBabyl Append Option&1"n zj !* Append. Will trim final whitespace!
!* just in case user put it there.!
!* This trimming stuff perhaps should go into just the Babylizer, and then!
!* have & Read Babyl file call the babylizer even if the file is a Babyl!
!* file -- it should do all the validity checking/trimming. --ECC!
-@f
: d !* Trim any whitespace and ^L at end,!
!* since ZMail might put them there.!
!* Avoid K since .,.K modifies!
!* buffer.!
0a-"n :i*Babyl bug: no ^_ at end of filefsErr !* Warn... !
i'' !* Put it in if continued !
"# j s' !* Prepend.!
!* Note that we do Babylization in the Babyl file, instead of in a temporary!
!* buffer. Thus we save space (fewer URKS for large files), but we have to!
!* worry about errors leaving a Babyl file with part of it not yet Babylized!
!* or partially version converted. So, we set up a ..N to do an HK and!
!* when we know it is ok, 0u..N.!
q3"e !* If perusing, just read in mail.!
!* This is true for 1G, or just!
!* reading some Babyl file without!
!* wriing back allowed.!
.,.fsBoundw fn hk !* ..N: Discard unless know is ok.!
1:< 1,er @y >w !* Read in file.!
0u6 !* 6: Will figure type of mail file.!
:f~BABYL OPTIONS:"e 1u6 !* 6: This is a Babyl file.!
1,m(m.mConvert Babyl File Version)w !* Convert if need.!
j :s b,.k' !* Discard BABYL OPTIONS section.!
"# :f~*APPEND*"e 2u6 k' !* 6: RMail file, chop off top.!
!* Try to figure out if this is an ITS or TNX mail (or RMail, without!
!* an *APPEND*) file: !
"# !* Not Babyl or appending RMail file.!
zj -@f
l !* To end. Backup over whitespace.!
0,0a-"e !* Ends with a ^_, so likely ITS...!
j:l -@f0123456789l !* To first line, end, back over!
!* digits. Maybe should just be 01?!
0,0a-;"n 2u6'''' !* Not ;nn...nn, so IS an ITS file.!
j q6-1"e 14.,1a-14."n :i*Babyl bug: should be ^L herefsErrw''
"# q6m(m.m& Babylize Buffer)' !* If not Babyl file convert.!
0u..n !* ..N: Buffer is now consistent.!
j ' !* Dont append or delete.!
fsXUName:f6u1 !* 1: Username.!
!* First check if there is no previous temporary file from a crashed Babyl,!
!* and if there is, we will skip the rename-mail-to[BABYL for the moment and!
!* use the existing [BABYL file. But we will set a flag to remind us to redo!
!* G later. It seems to be hard to have this crash mail combined with the!
!* real new stuff for the G Done Hook, but we print a message, so it may not!
!* really matter much -- rare.!
0u4 !* 4: Will redo G if becomes 1.!
e?[BABYL 1"e fsDFileu1 !* 1: Full temporary filename.!
ftThere is some mail from a previous Babyl crash.
It is being read in, and will be !* Warning.!
qBabyl Append Option&1"e ftafter'"# ftbefore' !* !
ft your new mail if any.
It is possible that it does not belong to this particular Babyl file.
(If you only have one Babyl file then it will belong. Otherwise you may want
to sort the messages out, using the O command to write them to other files.)
1u4' !* 4: Redo G later.!
"# !* No [BABYL file already.!
q2fsDFilew !* Default is mail filename.!
e?"n !* New mail not found.!
q4"e @ft(No new mail) 0fsEchoActivew' ' !* Do tell.!
fsOSTeco"n :'1< er ec !* open/close to set read date!
en[BABYL 1 !* Rename for safety.!
>+0"n fg ftCannot get new mail (cannot rename mail file).
Perhaps another program, such as MM or the mailer, has locked the mail file.
' !* Typical case on TNX.!
0u4' !* 4: Do not need another G.!
.,.fsBoundw !* set bounds to .,.!
e[fne] !* ..N: Push input. THIS ..N PUSHING!
!* MUST BE BEFORE THE HK-ONE SO THE!
!* 0U..N LATER WILL 0 THE RIGHT ..N.!
fn hk !* ..N: Discard new stuff if not known!
!* to be consistent.!
!* NO MORE FNs UNTIL THE 0U..N.!
:i*AReading Mail file 2fsEchoDisplayw
er fsIFileu5 !* 5: Name of read-in mail file, the!
!* [BABYL one.!
@y @ft
!* print CRLF when done!
qBabyl XMail Optionf"n u1 !* 1: XMail filename.!
e?1"N et1 eief ' !* If not there, create it.!
qBabyl XMail Append Option"n !* We are to append new mail.!
:i*AAppending to XMail filefsEchoDisplay
q1m(m.m& Babyl Append)"e !* Try fancy append.!
!* Didnt work.!
bj er1 fy !* Insert XMail at beginning.!
-@f k 0,0a-14."e -d' !* Strip off padding.!
f[DFile et[TECO] OUTPUT fsOSTeco"n 0fsDVersionw' !* Open to!
ei !* a safe (TNX) file.!
f]DFile hpef !* Write out new XMail file.!
b,.k' !* Kill old XMail part.!
fsOFileu1 !* 1: New XMail filename complete.!
@ft 1
0fsEchoActivew' !* Tell user what took time.!
"#
:i*APrepending to XMail filefsEchoDisplay
zj er1 @a !* Prepend new mail to XMail file.!
f[DFile et[TECO] OUTPUT fsOSTeco"n 0fsDVersionw' !* Open to!
ei !* a safe (TNX) file.!
f]DFile hpef !* Write out new XMail file.!
.,zk !* Kill old XMail stuff.!
fsOFileu1 !* 1: New XMail filename complete.!
@ft 1
0fsEchoActive''w !* Done XMail hacking.!
:f~BABYL OPTIONS:"e 1,m(m.mConvert Babyl File Version)w !* If need.!
j:s b,.k' !* Babyl file, chop off top.!
"# :f~*APPEND*"e k'' !* RMail file, chop off top.!
14.,1a-14."n !* If not Babyl file convert.!
m(m.m& Babylize Buffer)' j !* ...!
qBABYL Append Option&2"n !* User wants reversal.!
-. :s$w ' !* Keep Space after . there, else the!
!* sort is a no-op for some reason...!
0u..n !* ..N: Buffer now ok, can keep it.!
qBabyl Append Option&1"n !* Append.!
:i*AAppending to Babyl filefsEchoDisplay !* Tell user.!
q3m(m.m& Babyl Append)"n !* Can append?!
@ft 3
0fsEchoActivew' !* Yes, do it.!
"# m(m.m# Babyl S)'' !* No, just write full combined.!
"# m(m.m# Babyl S)' !* Prepend: write out combined files!
ed5 !* delete mail file!
q4"n oREDO-G' !* If all that just brought in mail!
!* from last crash, go check for some!
!* real mail.!
!# Babyl H:! !C# Reform or display original header.
If no argument, this forces the original header to be reformed. (You
can thus manually reform selected messages even if you don't have
messages normally reformed automatically -- i.e. if you set the No
Reformation option.) Reparse original header.
If argument, e.g. 1H, makes the original header be the visible header,
i.e. it unreforms.!
[1[2 !* save registers!
0,(fsZ)fsBoundw !* Wide bounds to include original.!
m(m.m& Reformed Bit)"n !* Message was reformed.!
m(m.m& Bounds Of Original Header)u2u1 !* 1,2: Bound original header.!
q1,q2x1 !* 1: Original header.!
fq1"e m(m.m& Babyl Select Message) !* Rebound message.!
!* There is no original header. Either it was discarded, or because!
!* of a bad header, the refBit was set and the original header is!
!* actually the visible one. In either case, we can just reset the!
!* refBit to 0, and try reforming. Nothing to lose, and if the user!
!* has edited the visible header to correct any problems, we can then!
!* reform ok.!
0m(m.m& Reformed Bit)w' !* Turn off the bit.!
"# :g1u2 0u2 !* Ensure room in address space.!
!* For a moment the address space held the old visible header + 2!
!* copies of the original header. This ensures that the G1 below will!
!* not get an urk and leave us without a visible header.!
m(m.m& Bounds Of Header)k !* Kill visible header, & jump there.!
g1'' !* Put original header in its place.!
m(m.m& Remove Basic Label)bad-headerw !* In case was bad, user!
!* corrected. If still bad,!
!* will be relabled.!
ff"e !* No NUMARG: wants reformation.!
m(m.m& Reform Header)' !* ...!
m(m.m& Babyl Select Message) !* Set bounds around message . is in.!
!# Babyl I:! !C# File out Babyl file, read in another.
After saving the current Babyl file (if necessary), asks for a Babyl
file. Default filename is DSK:homedir;username BABYL on ITS,
DSK:<homedir>username.BABYL on TNX. You can override this with
the option variable Babyl Default File.
If the Babyl file has an Owner option (either one user name or several
user names separated by commas), then only the specified user(s)
can modify the file.
If file is not a Babyl file, we just read -- no deleting, no writing.
The variable Babyl File Version controls the version written. See its
description for details.
If you try to read in a Babyl file that does not exist, offers to
create one, asking you about the various options.
If a numeric argument is given (e.g. 1I), deleting and writing are
inhibited. This is like forcing this user to definitely NOT be an
owner.
Teco programmers: describe the variable Before Babylizing File Hook.
qSubDoc"n i
A pre-comma NUMARG is a filename, so wont ask.'!
!* We try to assure robustness (not leaving a Babyl file with an inconsistent!
!* format, e.g. partially version converted) by first marking the buffer read!
!* only. Only after done do we mark it writable. (Not if 1I or not the owner!
!* though.)!
m(m.m& Declare Load-Time Defaults)
Babyl Filenames,: 0
Babyl O Filename,: 0
Babyl File Version, * 0: read max version, write back to same;
1: read and write version 1, similar for other positive N;
-1: read max version, write back to next version
This only applies to Tenex or Tops-20 systems.: 0
Babyl Default File, * Set this to specify your normal Babyl file. If 0,
Babyl figures out the default filename to use. If that is
wrong, you can set this. Set it to a string, the filename.
This is especially for users whose Babyl file is not in their
home directory, or not named from the user name. E.g. you
might have a subdirectory full of mail-files, and set this
variable to (for Tops-20) PS:<SMYTHE.MAIL>SMYTHE.BABYL: 0
[1 0[2 [3[4 !* 2: 1 if will find that Babyl file!
f[DFile !* should be writable.!
qBabyl File Versionu4 !* 4: Default version control.!
1f[FnamSyntax !* Lone fn is FN1, keeping FN2.!
!* Get filename of new Babyl file: *!
fsXUname:f6u1 etDSK:1 BABYL !* Default fn is <username> BABYL!
fsHSname fsDSnamew !* Default dir is home dir!
fsOSTeco"n q4+1"e 0'"# q4'fsDVersionw' !* For prompt. -1 means 0 for read.!
qBabyl Default Filef"n fsDFile'w !* Let user change default.!
ff&2"e !* no pre-comma NUMARG!
0[Buffer Filenames !* 0 so default filename printed!
m(m.m& Read Filename)Babyl fileu1 !* 1: Babyl filename!
]Buffer Filenames !* Restore.!
q1"e ' !* 0, abort.!
!* If user didnt specify version (or said 0 -- we cant tell), then maybe!
!* use a specific version: !
et1 !* Set for TNX version control.!
fsOSTeco"n q4"g fsDVersion"e q4fsDVersionw fsDFileu1'''' !* 1: Use!
!* version N.!
"# u1' !* 1: New MAIL file from pre-comma.!
!* Now that we have the filename, cleanup old Babyl file if any: *!
1,m(m.m# Babyl Q) !* cleanup, save previous Babyl!
!* file if necessary.!
:i*CfsEchoDisplay !* clear echo area!
!* Now we bring in the new Babyl file: !
et1 !* Set Babyl filename. Includes!
!* proper version by this time.!
fsDFilem(m.m& Read Babyl File)"n !* If read in a real Babyl file...!
ff&1"e 1u2'' !* 2: Non0 if can write.!
!* It reset fsDFile to be what was actually read. E.g. user may pick another!
!* filename. However, its version may be 0, and might need to be changed to!
!* specific N for writing back, if Babyl File Version is 0.!
fsOSTeco"n q4"e !* User wants writing back to same.!
fsDVersion"e !* Greatest was read in.!
fsIFVersionfsDVersionw''' !* So reset to use version read.!
fsDFileuBabyl Filenames !* Remember this filename.!
0uBuffer Filenames !* Mark it read only for now.!
0u:.b(qBuffer Index+2) !* ...!
-1uInhibit Write !* ...!
m(m.mConvert Babyl File Version)u3 !* 3: Non0 if version converted.!
m(m.m& Reset Babyl Options) !* Set options for this Babyl file.!
qBabyl Owner Optionf"n u1 f~(fsXUname:f6)1"n !* Owner?!
0u2''w !* 2: No, so no writeback.!
q2"n !* Allow write back if ok.!
fsDFilef(uBuffer Filenames !* ...!
)u:.b(qBuffer Index+2) !* ...!
0uInhibit Write !* ...!
!* Later we may only append to Babyl file. Dont want to append version!
!* n+1 stuff to version n Babyl file so save if converted.!
q3"n @m(m.m# Babyl S)'' !* Save if converted and writable.!
qBabyl Append Option&1"n zj -1'"# j's !* Put point at a good place,!
!* in case G gets nothing and thus!
!* keeps point where it is now.!
0u..h !* Allow redisplay when we are done,!
!* unless a user hook in G types.!
1,m(m.m# Babyl G) !* Get new mail, if any.!
qBabyl O Filename"e !* If havent yet got a default O!
et XMAIL !* filename, set it from the Babyls.!
fsOSTeco"n q4f"g fsDVersion'w' !* Set its version number now if N.!
fsDFileuBabyl O Filename' !* O may still fiddle with versions.!
qNumber of Babyl Messages"e !* Empty file. Shouldnt happen now.!
:i*Babyl bug: empty file. Please report the circumstancesfsErr
!* In case continued: !
:@m(m.m# Babyl Q)' !* ...!
:m(m.m& Babyl Select Message) !* Can select since are some messages!
!* there. Or it will create a dummy.!
!# Babyl J:! !C# Jump to message with given number.
nJ goes to message n whether deleted or not. ZJ goes to last message.
J goes to first non-deleted message.
-J goes to last non-deleted message.!
.[1 0fsVB[2 0fsVZ[3 [4 !* save . and bounds!
ff&1"e !* No argument means first message!
1m(m.m# Babyl J) !* ...!
m(m.m& Check Message Label)deleted"e ' !* if is not deleted.!
1:m(m.m# Babyl N)' !* Else call N to try next one.!
"l !* -J means last undeleted.!
qNumber Of Babyl Messagesm(m.m# Babyl J) !* ...!
m(m.m& Check Message Label)deleted"e ' !* Last message not deleted.!
1:m(m.m# Babyl P)' !* Was deleted, search for non.!
!* Here is where we try to optimize the movement. The safest way to move,
* that doesnt rely on Message Number and Number Of Babyl Messages
* being correct, is to go to the top and then search for N messages.
* However, I think we now maintain these variables pretty solidly, and so
* can trust them, unless we get an error, in which case they should be
* recalculated. So, we choose the best of these searches: from point
* forward, backward, from top forward, from bottome backward.
* !
-qMessage Numberf"gu4 !* 4: Moving forward n.!
!* ft(Moving forward)!
qNumber Of Babyl Messages--q4f"l+q4u4 !* 4: Faster searching!
!* ft(Searching Z back)!
!* backwards from end of buffer.!
!* Will leave point at end of!
!* desired message.!
!* Note: the f"l:s...' etc are because stupid 0:s wont return a value!
zj -q4f"l:s
"e oNoSuch''w'"#w !* 4: Faster searching forwards from!
!* ft(Searching . forward)!
!* point. Leave point at top of!
!* desired message.!
q4f"g:s
"e oNoSuch''w''
"#w !* ft(Moving backward)!
-(qMessage N