PeanutProfileImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, July 2, 1985 11:35:11 am PDT
DIRECTORY
Ascii USING [Lower],
Atom USING [MakeAtom],
PeanutProfile USING [],
Rope USING [ROPE, Translate, TranslatorType],
UserProfile USING [Boolean, CallWhenProfileChanges, Number, ProfileChangedProc, Token];
PeanutProfileImpl: CEDAR PROGRAM
IMPORTS Ascii, Atom, Rope, UserProfile
EXPORTS PeanutProfile
= BEGIN
ROPE: TYPE = Rope.ROPE;
automaticNewMail: PUBLIC BOOLFALSE; -- Peanut.AutomaticNewMail
toBeforeSubject: PUBLIC BOOLFALSE; -- Peanut.ToBeforeSubject
ccField: PUBLIC BOOLFALSE; -- Peanut.CarbonCopyField
ccToSelf: PUBLIC BOOLFALSE; -- Peanut.CarbonCopyToSelf
messageNodeFormat: PUBLIC ATOMNIL; -- Peanut.MessageNodeFormat
killViewersOnSaveAll: PUBLIC BOOLFALSE; -- Peanut.KillViewersOnSaveAll
startIconic: PUBLIC BOOLFALSE; -- Peanut.StartIconic
windowHeight: PUBLIC INT ← 0; -- Peanut.WindowHeight
activeMailFile: PUBLIC ROPENIL; -- Peanut.ActiveMailFile
outgoingMailFile: PUBLIC ROPENIL; -- Peanut.OutgoingMailFile
workingDirectory: PUBLIC ROPENIL; -- Peanut.WorkingDirectory
LCAtomFromRope: PROC [rope: ROPE] RETURNS [ATOM] ~ {
lowerCase: Rope.TranslatorType ~ { new ← Ascii.Lower[old] };
RETURN[Atom.MakeAtom[Rope.Translate[base: rope, translator: lowerCase]]];
};
ChangePeanutProfile: UserProfile.ProfileChangedProc = {
automaticNewMail ← UserProfile.Boolean["Peanut.AutomaticNewMail", FALSE];
toBeforeSubject ← UserProfile.Boolean["Peanut.ToBeforeSubject", FALSE];
ccField ← UserProfile.Boolean["Peanut.CarbonCopyField", TRUE];
ccToSelf ← UserProfile.Boolean["Peanut.CarbonCopyToSelf", TRUE];
messageNodeFormat ← LCAtomFromRope[UserProfile.Token["Peanut.MessageNodeFormat", NIL]];
killViewersOnSaveAll ← UserProfile.Boolean["Peanut.KillViewersOnSaveAll", FALSE];
startIconic ← UserProfile.Boolean["Peanut.StartIconic", TRUE];
windowHeight ← UserProfile.Number["Peanut.WindowHeight", 80];
activeMailFile ← UserProfile.Token["Peanut.ActiveMailFile", "Active"];
outgoingMailFile ← UserProfile.Token["Peanut.OutgoingMailFile", ""];
workingDirectory ← UserProfile.Token["Peanut.WorkingDirectory", NIL];
};
UserProfile.CallWhenProfileChanges[ChangePeanutProfile];
END.