<> <> <> <> <> <> <> <> <<>> 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.