PeanutProfileImpl.mesa
Copyright Ó 1985, 1990, 1992 by Xerox Corporation. All rights reserved.
Doug Wyatt, July 2, 1985 11:35:11 am PDT
Bertrand Serlet June 27, 1986 2:24:59 pm PDT
Willie-Sue Orr, November 7, 1989 1:21:16 pm PST
Last changed by Pavel on March 7, 1990 11:50 am PST
Michael Plass, January 10, 1992 5:35 pm PST
Kenneth A. Pier, July 6, 1992 5:09 pm PDT
DIRECTORY
Ascii USING [Lower],
Atom USING [MakeAtom],
PeanutProfile USING [],
Rope USING [ROPE, Size, Translate, TranslatorType],
UserProfile USING [Boolean, CallWhenProfileChanges, ListOfTokens, Number, ProfileChangedProc, Token];
PeanutProfileImpl: CEDAR PROGRAM
IMPORTS Ascii, Atom, Rope, UserProfile
EXPORTS PeanutProfile
= BEGIN
ROPE: TYPE = Rope.ROPE;
activeMailFile: PUBLIC ROPE; -- Peanut.ActiveMailFile
automaticNewMail: PUBLIC BOOL; -- Peanut.AutomaticNewMail
ccField: PUBLIC BOOL; -- Peanut.CarbonCopyField
ccToSelf: PUBLIC BOOL; -- Peanut.CarbonCopyToSelf
commentNewHeaders: PUBLIC BOOL; -- Peanut.CommentNewHeaders
messageNodeFormat: PUBLIC ATOM; -- Peanut.MessageNodeFormat
outgoingMailFile: PUBLIC ROPE; -- Peanut.OutgoingMailFile
plainTextMessageFormat: PUBLIC ATOM; -- Peanut.PlainTextMessageFormat
recipients: PUBLIC ROPE; -- Peanut.Recipients
signature: PUBLIC ROPE; -- Peanut.Signature
startIconic: PUBLIC BOOL; -- Peanut.StartIconic
toBeforeSubject: PUBLIC BOOL; -- Peanut.ToBeforeSubject
windowHeight: PUBLIC INT; -- Peanut.WindowHeight
workingDirectory: PUBLIC ROPE; -- Peanut.WorkingDirectory
fixupXNSAddresses: PUBLIC LIST OF ROPE; -- Peanut.FixupXNSAddresses
LCAtomFromRope:
PROC [rope:
ROPE]
RETURNS [
ATOM] ~ {
lowerCase: Rope.TranslatorType ~ { RETURN[Ascii.Lower[old]] };
IF Rope.Size[rope] = 0 THEN RETURN [NIL];
RETURN[Atom.MakeAtom[Rope.Translate[base: rope, translator: lowerCase]]];
};
ChangePeanutProfile: UserProfile.ProfileChangedProc = {
activeMailFile ¬ UserProfile.Token["Peanut.ActiveMailFile", "Active"];
automaticNewMail ¬ UserProfile.Boolean["Peanut.AutomaticNewMail", FALSE];
ccField ¬ UserProfile.Boolean["Peanut.CarbonCopyField", TRUE];
ccToSelf ¬ UserProfile.Boolean["Peanut.CarbonCopyToSelf", TRUE];
commentNewHeaders ¬ UserProfile.Boolean["Peanut.CommentNewHeaders", TRUE];
messageNodeFormat ¬ LCAtomFromRope[UserProfile.Token["Peanut.MessageNodeFormat", NIL]];
outgoingMailFile ¬ UserProfile.Token["Peanut.OutgoingMailFile", ""];
plainTextMessageFormat ¬ LCAtomFromRope[UserProfile.Token["Peanut.PlainTextMessageFormat", "default"]];
recipients ¬ UserProfile.Token["Peanut.Recipients", "Recipients"];
signature ¬ UserProfile.Token["Peanut.Signature", NIL];
startIconic ¬ UserProfile.Boolean["Peanut.StartIconic", TRUE];
toBeforeSubject ¬ UserProfile.Boolean["Peanut.ToBeforeSubject", FALSE];
windowHeight ¬ UserProfile.Number["Peanut.WindowHeight", 80];
workingDirectory ¬ UserProfile.Token["Peanut.WorkingDirectory", NIL];
fixupXNSAddresses ¬ UserProfile.ListOfTokens["Peanut.FixupXNSAddresses", NIL];
};
UserProfile.CallWhenProfileChanges[ChangePeanutProfile];
END.