1
0
mirror of synced 2026-01-18 01:22:09 +00:00
Interlisp.medley/docs/primer/08-YOUR-INIT.TEDIT
2020-12-13 17:04:48 -07:00

27 lines
12 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1
Medley for the Novice, Release 2.0
1
Medley for the Novice, Release 2.0
8. YOUR INIT FILE
1
8. YOUR INIT FILE
1
"8"8. YOUR INIT FILE
6
Lisp has a number of global variables that control the environment. Global variables make it easy to customize the environment to fit your needs. One way to do this is to develop an INIT file(INIT% FILE NIL INIT% file NIL NIL 1). This is a file that is loaded when you start an image. You can use it to set variables, load files, define functions, and any other things that you want to do to make the Medley environment suit you.
Using the USERGREETFILES Variable
1
As described in File Variables section of Chapter 11, each program file has a global Your INIT file could be called INIT, INIT.LISP, INIT.USER, or whatever the convention is at your site. There is no default name preferred by the system, it just looks for the files listed in the variable USERGREETFILES (see below). Check to see what the preference is at your site. Put this file in your directory. Your directory name should be the same as your login name. The INIT file is loaded by the function GREET. GREET is normally run when Medley is started. If this is not the case at your site, or you want to use the machine and Medley has already been started, you can run the function GREET(GREET (Function) NIL NIL NIL 1) yourself. If your user name was, for example, TURING, then you would type:
(GREET 'TURING)
This does a number of things, including undoing any previous greeting operation, loading the site init file, and loading your init file. Where GREET looks for your INIT file depends on the value of the variable USERGREETFILES(USERGREETFILES (Variable) NIL NIL NIL 1). The value of this variable is set when the system's SYSOUT file is made, so check its value at your site! For example, its value could be:
¼K ÆyûãçÏß¿~Ø?< ÆÍƒ66l `Ø0f Æáƒ6l `Ø0p EÆyó6voŸ |Ø>< yÀÆ=ƒæ7Ì `Ø0 EÆ
ƒ66l `Ø0 EÆÍƒ6vl `Ø0f |ùû3¶oߌ`ß¿| 0 ˆDqð@8ˆ@  B$Id @
"DØ@ @B$Jd @ "DØ @B#T @ AT @ @B$IL @`"D¨ @B$H„L @¢"D¨ ˆDp@Â8ˆ@  @@ 0 0 ˆDqðŽ>x<01>" B$Id @ D 6 @B$Jd @ D 6 @B#T @Œ<x@* AT Cà P@* @B$IL @ H˜* @B$H„L @ D¨€* ˆDp@>D0€" @ 0 0@ ˆDqðŽ>x B$Id @ D @B$Jd @ D @B#T @Œ<x AT Cà P @B$IL @ H @B$H„L @ D ˆDp@>D @ 0@ 0 ˆDqð<71> B$Id @<40> @B$Jd @@€ @B#T @@€ AT @@€ @B$IL @@€ @B$H„L @@€ ˆDp@<40> @<00> 0
Figure 8-1. Possible Value of USERGREETFILES
In each place you see >USER>, the argument passed to GREET is substituted into the path. This is your login name if you are just starting Medley. For example, the first value in the list would have the system check to see whether there was a {DSK}<LISPFlLES>TURING>INIT.LISP file. No error is generated if you do not have an INIT file, and none of the files in USERGREETFILES are found.
Making an Init File
1
As described in File Variables section of Chapter 11, each program file has a global variable associated with it, whose name is formed by appending COMS to the end of the root filename. For any of the standard INIT file(INIT% FILE NIL INIT% file NIL NIL 1 SUBNAME MAKING SUBTEXT making) names, the variable INITCOMS is used. To set up an init file, begin by editing this variable. Type:
(DV INITCOMS)
An SEdit window wiil appear. This window is the same as the one called with the function DF, and described in the Using the List Structure Editor section in Chapter 7. This chapter assumes that you know how to use the SEdit structure editor .
The COMS(COMS (Variable) NIL NIL NIL 2) variable is a list of lists. The first atom in each internal list specifies for the file package what types of items are in the list, and what it is to do with them. This section will deal with three types of lists: VARS, FILES, and P. Please read about others in Chapter 17 of the IRM.
Notice that inside the vars list, there is yet another list. The first item in the list is the name of the variable. It is bound to the value of the second item. There are many other variables that you can set by adding them to the VARS list. Some of these variables are described in Chapter 24, and many others can be found in the IRM.
If you want to automatically load files, that can be done in your init file also. For example, if you always want to load tho Library file SPY.LCOM, you can load it by editing tho INITCOMS(INITCOMS (Variable) NIL NIL NIL 2) variable to list the appropriate file in the list starting with FILES:
.
.
.
(FILES SPY)
.
.
.
Figure 8-2. INITCOMS Changed to Load SPY.LCOM File
Other files can also be added by simply adding their names to this FILES list.
Another list that can appear in a COMS list begins with P. This list contains Lisp expressions that are evaluated when the file is loaded. Do not put DEFINEQ expressions in this list. Define the function in the environment, and then save it on the file in the usual way (see Chapter 7).
One type of expression you might want to see here, however, is a FONTCREATE(FONTCREATE (Function) NIL NIL NIL 2) function (see Chapter 16). For example, of you want to use a Helvetica 12 BOLD font, and there is not a fontdescriptor for it normally in your environment, the appropriate call to FONTCREATE should be in the "P" list. The INITCOMS would look like this:
.
.
.
(FILES SPY)
(P (FONTCREATE 'HELVETICA 12 'BOLD))
.
.
.
Figure 8-3. INITCOMS Edited to Include a call to FONTCREATE
To quit, exit from SEdit in the usual way. When you run the function MAKEFILES (see Chapter 7), be sure that you are connected to the directory (see Chapter 4) where the INIT file should appear. Now when GREET is run, your Init file will be loaded.
(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "8-" "") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "8-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "8-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "8-" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "8-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "8-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))))),,lHà,HHà,HHà
,HHà-àT-àT,HHà2àà5àÌàFøø PAGEHEADING VERSOHEADFøø PAGEHEADING RECTOHEADEøø PAGEHEADINGFOOTINGVEøø PAGEHEADINGFOOTINGR,
CLASSIC
TITAN
CLASSIC HELVETICAMODERN HELVETICACLASSIC
 HELVETICA
MODERN

TIMESROMAN
 HRULE.GETFNMODERN
 "
 HRULE.GETFNCLASSIC

#   HRULE.GETFNCLASSIC
   HRULE.GETFNCLASSIC
 

IM.CHAP.GETFN HELVETICA  HRULE.GETFNMODERN
%IM.INDEX.GETFNÊ" HRULE.GETFNCLASSIC
Z    ¬ IM.INDEX.GETFN/<00>?)IM.INDEX.GETFN6
P BMOBJ.GETFN3
TIMESROMAN

¹ 3   HRULE.GETFNCLASSIC
:CIM.INDEX.GETFNHYIM.INDEX.GETFNÙ0L!#IM.INDEX.GETFNA  C"]A
%IM.INDEX.GETFN
 * 

E \(5àzº