{Begin SubSec Greeting and Initialization Files}
{Title Greeting and Initialization Files}
{Text

{Tag Greeting}
{index *PRIMARY* Greeting}

Many of the features of Interlisp are controlled by variables that the user can adjust to his or her own tastes.  In addition, the user can modify the action of system functions in ways not specifically provided for by using {fn ADVISE} ({PageRef Fn ADVISE}).  In order to encourage customizing the Interlisp environment, Interlisp includes a facility for automatically loading {index *PRIMARY* Initialization files}initialization files (or {index *PRIMARY* Init files}"init files") when an Interlisp system is first started.  Each user can have a separate {index User init file}"user init file" that customizes the Interlisp environment to his/her tastes.  In addition, there can be a {index *PRIMARY* Site init file}"site init file" that applies to all users at a given physical site, setting system variables that are the same for all users such as the name of the nearest printer, etc.

The process of loading init files, also known as "greeting",{index Greeting}, occurs when an Interlisp system created by {fn MAKESYS} ({PageRef Fn MAKESYS}) is started for the first time.  The user can also explicitly invoke the greeting operation at any time via the function {fn GREET} (below).  The process of greeting includes the following steps:

{Begin NumberedList The process of greeting}

{Item
Any previous greeting operation is undone.  The side effects of the greeting operation are stored on a global variable as well as on the history list, thus enabling the previous greeting to be undone even if it has dropped off of the bottom of the history list.  
}

{Item
All of the items on the list {var PREGREETFORMS}{index PREGREETFORMS Var} are evaluated.
}

{Item
The site init file is loaded.  {fn GREET} looks for a file by the name {lisp {bracket DSK}INIT.LISP}.{index INIT.LISP (File name)}  If this is found, it is loaded.  If it is not found, the system prints "{lisp Please enter name of system init file (e.g. {bracket server}<directory>INIT.extension):}" and waits for the user to type a file name, followed by a carriage return.  If the user just types a carriage return without typing a file name, no site init file is loaded.  Note:  The site init file is loaded with {arg LDFLG} set to {lisp SYSLOAD}, so that no file package information is saved, and nothing is printed out. 
}

{Item
The user init file is loaded.  The user init file is found by using the variable {var USERGREETFILES} (described below), which is normally set in the site init file.  The user init file is loaded with normal file package settings, but under errorset protection and with {var PRETTYHEADER} set to {lisp NIL} to suppress the "{lisp FILE CREATED}" message.
}

{Item
All of the items on the list {var POSTGREETFORMS}{index POSTGREETFORMS Var} are evaluated.
}

{Item
A greeting is printed such as "{lisp Hello, {arg XXX}.}", where {arg XXX} is the value of the variable {index *PRIMARY* FIRSTNAME Var}{var FIRSTNAME} (if non-{lisp NIL}).  The variable {var GREETDATES} (below) can be set to modify this greeting for particular dates.
}

{End NumberedList The process of greeting}


{FnDef {FnName GREET} {FnArgs NAME {anonarg}}
{Text
Performs the greeting for the user whose username is {arg NAME} (if {arg NAME}={lisp NIL}, uses the login name).  When Interlisp first starts up, it performs {lisp (GREET)}.
}}

{FnDef {FnName GREETFILENAME} {FnArgs USER}
{Text
If {arg USER} is {lisp T}, {fn GREETFILENAME} returns the file name of the site init file, asking the user if it doesn't exist.  Otherwise, {arg USER} is interpreted to be a user's system name, and {fn GREETFILENAME} returns the file name for the user init file (if it exists).
}}


{VarDef {Name USERGREETFILES}
{Text
{var USERGREETFILES} specifies a series of file names to try as the user init file.  The value of {var USERGREETFILES} is a list, where each element is a list of litatoms.  For each item in {var USERGREETFILES}, the user name is substituted for the litatom {lisp USER} and the value of {var COMPILE.EXT} ({PageRef Var COMPILE.EXT}) is substituted for the litatom {lisp COM}, and the litatoms are packed into a single file name.  The first such file that is found is the user init file.

For example, suppose that the value of {var USERGREETFILES} was

{lispcode
(({bracket ERIS}< USER >LISP>INIT. COM)
 ({bracket ERIS}< USER >LISP>INIT)
 ({bracket ERIS}< USER >INIT. COM)
 ({bracket ERIS}< USER >INIT))}

If the user name was {lisp JONES}, and the value of {var COMPILE.EXT} was {lisp DCOM}, then this would search for the files {lisp {bracket ERIS}<JONES>LISP>INIT.DCOM}, {lisp {bracket ERIS}<JONES>LISP>INIT}, {lisp {bracket ERIS}<JONES>INIT.DCOM}, and {lisp {bracket ERIS}<JONES>INIT}.

Note:  The file name "specifications" in {var USERGREETFILES} should be fully qualified, including all host and directory information.  The directory search path (the value of {var DIRECTORIES}, {PageRef Var DIRECTORIES}) is {it not} used to find the user greet files.
}}


{VarDef {Name GREETDATES}
{Text
The value of {var GREETDATES} can be used to specify special greeting messages for various dates.  {var GREETDATES} is a list of elements of the form {lisp ({arg DATESTRING} . {arg STRING})}, e.g. {lisp ("25-DEC" . "Merry Christmas")}.  The user can add entries to this list in his/her {lisp INIT.LISP} file by using a {filecom ADDVARS} file package command like {lisp (ADDVARS (GREETDATES ("8-FEB" . "Happy Birthday")))}.  On the specified date, the {fn GREET} will use the indicated salutation.
}}


Note:  Users should try to make sure that their init file is "undoable".  If they use the file package command "{lisp P}" ({PageRef FileCom P}) to put expressions on the file to be evaluated, they should use the "undoable" version, e.g. {fn /SETSYNTAX} rather than {fn SETSYNTAX}, etc (see {PageRef Term / Functions}).  This is so another user can come up, do a {lisp (GREET)} and have the first user's initialization undone.


It is impossible to give a complete list of all of the variables and functions that users may want to set in their init files.  The default values for system variables are chosen in the hope that they will be correct for the majority of users, so many users get along with very small init files.  The following describes some of the variables that users may want to reset in their init files:

{Begin LabeledList Variables for INIT files}

{Label Directories}
{Text
The variables {index DIRECTORIES Var}{var DIRECTORIES} and {index LISPUSERSDIRECTORIES Var}{var LISPUSERSDIRECTORIES} ({PageRef Var DIRECTORIES}) contain lists of directories used when searching for files.  {index LOGINHOST/DIR Var}{Var LOGINHOST/DIR} ({PageRef Var LOGINHOST/DIR}) determines the default directory used when calling {lisp CONN} with no argument.
}

{Label Fonts and Printing}
{Text
The variables {index DISPLAYFONTDIRECTORIES Var}{var DISPLAYFONTDIRECTORIES}, {index DISPLAYFONTEXTENSIONS Var}{var DISPLAYFONTEXTENSIONS}, {index Interpress format}{index INTERPRESSFONTDIRECTORIES Var}{var INTERPRESSFONTDIRECTORIES}, and {index Press format}{index PRESSFONTWIDTHSFILES Var}{var PRESSFONTWIDTHSFILES} ({PageRef Var DISPLAYFONTDIRECTORIES}) must be set before fonts can be automatically loaded from files.  {index DEFAULTPRINTINGHOST Var}{var DEFAULTPRINTINGHOST} ({PageRef Var DEFAULTPRINTINGHOST}) should be set before attempting to generate hardcopy to a printer.
}

{Label Network Systems}
{Text
{index CH.DEFAULT.ORGANIZATION Var}{var CH.DEFAULT.ORGANIZATION} and {index CH.DEFAULT.DOMAIN Var}{var CH.DEFAULT.DOMAIN} ({PageRef Var CH.DEFAULT.ORGANIZATION}) should be set to the default NS organization and domain, when using NS network communications.  If {index CH.NET.HINT Var}{var CH.NET.HINT} ({PageRef Var CH.NET.HINT}) is set, it can reduce the amount of time spent searching for a clearinghouse.
}

{Label Interlisp-D Executive}
{Text
The variable {index PROMPT#FLG Var}{var PROMPT#FLG} ({PageRef Var PROMPT#FLG}) determines whether an "event number" is printed at the beginning of every input line.  The function {index CHANGESLICE Fn}{fn CHANGESLICE} ({PageRef Fn CHANGESLICE}) can be used to change the number of events that are remembered on the history list.
}

{Label Copyright Notices}
{Text
{index COPYRIGHTFLG Var}{var COPYRIGHTFLG}, {index COPYRIGHTOWNERS Var}{var COPYRIGHTOWNERS}, and {index DEFAULTCOPYRIGHTOWNER Var}{var DEFAULTCOPYRIGHTOWNER} ({PageRef Var COPYRIGHTFLG}) control the inclusion of copyright notices on source files.
}

{Label Printing Functions}
{Text
{index **COMMENT**FLG Var}{var **COMMENT**FLG} ({PageRef Var **COMMENT**FLG}) determines how program comments are printed.  {index FIRSTCOL Var}{var FIRSTCOL}, {index PRETTYFLG Var}{var PRETTYFLG}, and {index CLISPIFYPRETTYFLG Var}{var CLISPIFYPRETTYFLG} ({PageRef Var FIRSTCOL}) are among the many variables controlling how functions are pretty printed.
}

{Label List Structure Editor}
{Text
The variable {index INITIALSLST Var}{var INITIALSLST} ({PageRef Var INITIALSLST}) is used when "time-stamps" are inserted in a function when it is edited.  {index EDITCHARACTERS Var}{var EDITCHARACTERS} ({PageRef Var EDITCHARACTERS}) is used to set the read macros used in the teletype editor.
}

{End LabeledList Variables for INIT files}



}{End SubSec Greeting and Initialization Files}