4
|
1 |
"*
|
|
2 |
* $Header$
|
|
3 |
*
|
|
4 |
* sample private.rc - file
|
|
5 |
*
|
10
|
6 |
* a copy of this file can (should) reside in your home or
|
|
7 |
* current directory - put all private preferences in here.
|
25
|
8 |
* notice, you will find some things enclosed in
|
|
9 |
* ... getLoginName = 'claus' ifTrue:[
|
|
10 |
*
|
|
11 |
* these are my personal preferrences which will be
|
|
12 |
* ignored in your environment, but are taken in mine.
|
|
13 |
* That way, I dont have to maintain two different 'private.rc' files.
|
|
14 |
* (you may want to have a look into it - some is of general interrest)
|
4
|
15 |
*"
|
|
16 |
|
25
|
17 |
"/
|
|
18 |
"/ this turns off information messages from classes
|
|
19 |
"/ (such as 'D8IMAGE: allocating colors ...'
|
|
20 |
"/
|
|
21 |
"/ Object infoPrinting:false.
|
|
22 |
Object infoPrinting:true.
|
|
23 |
|
|
24 |
"/
|
|
25 |
"/ this turns off information messages from the VM
|
|
26 |
"/ (such as 'MEM: chitty chatty ...'
|
|
27 |
"/
|
|
28 |
"/ ObjectMemory infoPrinting:false.
|
|
29 |
ObjectMemory infoPrinting:true.
|
|
30 |
|
|
31 |
"/
|
|
32 |
"/ this turns off error/fatal messages from the VM
|
|
33 |
"/ (it does not really make sense to turn them off)
|
|
34 |
"/
|
|
35 |
"/ Smalltalk debugPrinting:false.
|
|
36 |
|
|
37 |
"/
|
|
38 |
"/ set the package for fileIns done below
|
|
39 |
"/
|
24
|
40 |
Project notNil ifTrue:[
|
|
41 |
Project setDefaultProject.
|
25
|
42 |
Project current packageName:#'goody-fileIn'.
|
24
|
43 |
].
|
|
44 |
!
|
|
45 |
|
25
|
46 |
"/ a kludge: some Xservers send #Delete for both the backspace
|
|
47 |
"/ and the Delete key. In this case, we use the Backspace function
|
|
48 |
"/ for both keys. If your Xserver does not do this (it should not)
|
|
49 |
"/ remove or comment the following 'bindValue:#BackSpace'-line:
|
|
50 |
"/
|
|
51 |
|map macros|
|
24
|
52 |
|
|
53 |
map := Display keyboardMap.
|
25
|
54 |
map bindValue:#BackSpace to:#Delete.
|
|
55 |
|
|
56 |
"/
|
|
57 |
"/ my personal preferences - make it unconditional if you like them
|
|
58 |
"/
|
|
59 |
OperatingSystem getLoginName = 'claus' ifTrue:[
|
|
60 |
map bindValue:#Compose to:#'Control_R'. "/ remove this line, if your keyboard has a compose-key
|
|
61 |
|
|
62 |
|
|
63 |
"/
|
|
64 |
"/ convenient functions on the keyboard
|
|
65 |
"/
|
|
66 |
map bindValue:#Again to:#F1.
|
|
67 |
map bindValue:#UserInterrupt to:#Break.
|
|
68 |
map bindValue:#PrintIt to:#Print. "/ called PrintScreen on most keyboards
|
|
69 |
map bindValue:#InspectIt to:#Execute. "/ called SysReq on most keyboards
|
|
70 |
|
|
71 |
"/
|
|
72 |
"/ have F5 paste the output of a selected unix command ..
|
|
73 |
"/ have CtrlTab toggle between 4 and 8 col tab setting
|
|
74 |
"/ F6/F7 is cool (not available on all systems):
|
|
75 |
"/ F6 sends the selection to spell ,
|
|
76 |
"/ F7 locates the next spelling error and searches for these word(s)
|
|
77 |
"/ F10 indents selection by 4
|
|
78 |
"/ F9 undents selection by 4
|
|
79 |
"/
|
|
80 |
"/ F3 comments a (multiline) selection
|
|
81 |
"/ F4 uncomments a (multiline) selection
|
|
82 |
"/
|
|
83 |
macros := Smalltalk at:#FunctionKeySequences.
|
|
84 |
macros isNil ifTrue:[
|
|
85 |
macros := IdentityDictionary new.
|
|
86 |
Smalltalk at:#FunctionKeySequences put:macros.
|
|
87 |
].
|
|
88 |
"/ replace selection by unix command
|
|
89 |
macros at:#F99 put:'
|
|
90 |
"replace selection by
|
|
91 |
corresponding
|
|
92 |
unix commands output"
|
|
93 |
|
|
94 |
|sel|
|
|
95 |
|
|
96 |
sel := self selection.
|
|
97 |
sel notNil ifTrue:[
|
|
98 |
self replace:
|
|
99 |
(PipeStream readingFrom:(sel asString))
|
|
100 |
contents asString
|
|
101 |
]'.
|
|
102 |
|
|
103 |
"/ toggle tabs
|
|
104 |
macros at:#F98 put:'
|
|
105 |
"toggle between 4-col
|
|
106 |
and 8-col tabs"
|
|
107 |
|
|
108 |
(tabPositions == self class tab4Positions)
|
|
109 |
ifTrue:[self setTab8]
|
|
110 |
ifFalse:[self setTab4]'.
|
|
111 |
|
|
112 |
"/ get next spelling error, and select it
|
|
113 |
macros at:#F97 put:'
|
|
114 |
|errs thisErr sl sc|
|
|
115 |
|
|
116 |
thisErr := Smalltalk at:#''_thisError''.
|
|
117 |
thisErr isNil ifTrue:[
|
|
118 |
errs := Smalltalk at:#''_spellOutput''.
|
|
119 |
(errs notNil and:[errs notEmpty]) ifTrue:[
|
|
120 |
thisErr := errs removeFirst.
|
|
121 |
errs isEmpty ifTrue:[Smalltalk removeKey:''_spellOut'']
|
|
122 |
].
|
|
123 |
Smalltalk at:#''_lastErrLine'' put:1.
|
|
124 |
Smalltalk at:#''_lastErrCol'' put:1.
|
|
125 |
].
|
|
126 |
thisErr notNil ifTrue:[
|
|
127 |
sl := Smalltalk at:#''_lastErrLine''.
|
|
128 |
sc := Smalltalk at:#''_lastErrCol''.
|
|
129 |
self searchForwardFor:thisErr
|
|
130 |
startingAtLine:sl col:sc
|
|
131 |
ifFound:[:fl :fc | self selectWordAtLine:fl col:fc.
|
|
132 |
Smalltalk at:#''_lastErrLine'' put:fl.
|
|
133 |
Smalltalk at:#''_lastErrCol'' put:fc+1]
|
|
134 |
ifAbsent:[self device beep]
|
|
135 |
]'.
|
|
136 |
|
|
137 |
"/ send contents to spell; remember spelling errors
|
|
138 |
"/ does not work on all systems (some do not have spell ...)
|
|
139 |
macros at:#F96 put:'
|
|
140 |
|p f s|
|
7
|
141 |
|
25
|
142 |
f := Filename newTemporary. s := f writeStream.
|
|
143 |
s nextPutAll:self contents asString.
|
|
144 |
s close.
|
|
145 |
p := PipeStream readingFrom:''spell '' , f pathName.
|
|
146 |
Smalltalk at:#''_spellOutput'' put:p contents asString asCollectionOfLines.
|
|
147 |
p close.
|
|
148 |
self information:''F7 positions on the next spelling error''.
|
|
149 |
'.
|
|
150 |
|
|
151 |
"/ indent by 4
|
|
152 |
macros at:#F95 put:'
|
|
153 |
"indent selected line-range
|
|
154 |
by 4 spaces (i.e. to the right)"
|
|
155 |
|
|
156 |
self selectionStartLine to:self selectionEndLine-1 do:[:lineNr |
|
|
157 |
|line|
|
|
158 |
|
|
159 |
line := self listAt:lineNr.
|
|
160 |
line notNil ifTrue:[
|
|
161 |
line notEmpty ifTrue:[
|
|
162 |
line := '' '' , line.
|
|
163 |
self at:lineNr put:line
|
|
164 |
]
|
|
165 |
]
|
|
166 |
]
|
|
167 |
'.
|
|
168 |
"/ undent by 4
|
|
169 |
macros at:#F94 put:'
|
|
170 |
"undent selected line-range
|
|
171 |
by 4 spaces (i.e. to the left)"
|
|
172 |
|
|
173 |
self selectionStartLine to:self selectionEndLine-1 do:[:lineNr |
|
|
174 |
|line|
|
|
175 |
|
|
176 |
line := self listAt:lineNr.
|
|
177 |
line notNil ifTrue:[
|
|
178 |
line notEmpty ifTrue:[
|
|
179 |
(line startsWith:'' '') ifTrue:[
|
|
180 |
line := line copyFrom:5.
|
|
181 |
self at:lineNr put:line
|
|
182 |
]
|
|
183 |
]
|
|
184 |
]
|
|
185 |
]
|
|
186 |
'.
|
|
187 |
|
|
188 |
map bindValue:#CmdF99 to:#F5.
|
|
189 |
map bindValue:#CmdF98 to:#CtrlTab.
|
|
190 |
"/ map bindValue:#CmdF97 to:#F7.
|
|
191 |
"/ map bindValue:#CmdF96 to:#F6.
|
|
192 |
map bindValue:#CmdF95 to:#F10.
|
|
193 |
map bindValue:#CmdF94 to:#F9.
|
|
194 |
|
|
195 |
map bindValue:#CommentSelection to:#F3.
|
|
196 |
map bindValue:#UncommentSelection to:#F4.
|
|
197 |
|
|
198 |
"/
|
|
199 |
"/ since some of my machines have german keyboards ;-)
|
|
200 |
"/ and I like to be able to edit my files on all machines,
|
|
201 |
"/ I need a translation in both ways.
|
|
202 |
"/ you'd normally not define things in both directions.
|
|
203 |
"/
|
|
204 |
"/ actually, these things belong into d_xxx.rc ...
|
|
205 |
"/
|
|
206 |
"/ german national characters on a US keyboard:
|
|
207 |
"/
|
|
208 |
map bindValue:(Character value:16rFC) to:#'Cmd['.
|
|
209 |
map bindValue:(Character value:16rE4) to:#'Cmd'''.
|
|
210 |
map bindValue:(Character value:16rF6) to:#'Cmd;'.
|
|
211 |
map bindValue:(Character value:16rDC) to:#'Cmd{'.
|
|
212 |
map bindValue:(Character value:16rC4) to:#'Cmd"'.
|
|
213 |
map bindValue:(Character value:16rD6) to:#'Cmd:'.
|
|
214 |
map bindValue:(Character value:16rDF) to:#'Cmd-'.
|
|
215 |
|
|
216 |
"/
|
|
217 |
"/ US characters on german keyboard:
|
|
218 |
"/
|
|
219 |
map bindValue:$[ to:#'Alt['.
|
|
220 |
map bindValue:$] to:#'Alt]'.
|
|
221 |
map bindValue:$| to:#'Alt|'.
|
|
222 |
map bindValue:${ to:#'Alt{'.
|
|
223 |
|
|
224 |
"/
|
|
225 |
"/ no matter what the 'display.rc' says:
|
|
226 |
"/ I want my #iris style ...
|
|
227 |
"/
|
|
228 |
View defaultStyle:#iris
|
|
229 |
].
|
|
230 |
|
|
231 |
|
|
232 |
"/ add my private directories to the searchPath ...
|
|
233 |
"/ This does not make sense in your environment.
|
|
234 |
"/ However, I leave the code here to show how its done.
|
|
235 |
"/
|
24
|
236 |
Smalltalk systemPath addFirst:'../..'.
|
|
237 |
|
16
|
238 |
OperatingSystem getLoginName = 'claus' ifTrue:[
|
|
239 |
Smalltalk systemPath addFirst:'/phys/clam/claus/smalltalk/not_delivered'.
|
|
240 |
Smalltalk systemPath addFirst:'/phys/clam/claus/smalltalk/private_classes'.
|
20
|
241 |
Smalltalk systemPath addFirst:'/phys/clam/claus/work/fileIn/not_delivered'.
|
25
|
242 |
Smalltalk systemPath addFirst:'../../libpro'.
|
16
|
243 |
].
|
25
|
244 |
|
|
245 |
"/ since smalltalk keeps track of which directories exist
|
|
246 |
"/ in the path, this cache has to be flushed whenever new directories
|
|
247 |
"/ are added to the path:
|
|
248 |
"/
|
24
|
249 |
Smalltalk flushPathCaches.
|
16
|
250 |
|
25
|
251 |
"/
|
|
252 |
"/ color allocation strategy:
|
|
253 |
"/
|
|
254 |
"/ the default is to allocate from the colormap as required.
|
|
255 |
"/ As long as the number of distinct colors used is less than the number
|
|
256 |
"/ of available colors (which is usually the case) this leads to better looking
|
|
257 |
"/ images.
|
|
258 |
"/ However, if many images are to be displayed simulatiously, images displayed
|
|
259 |
"/ first may steal too many colors required in images displayed later.
|
|
260 |
"/ In this case, it is better to preallocate some colors, and dither all images
|
|
261 |
"/ using theese. Of course, while making the worst case better, this makes
|
|
262 |
"/ the best case worse. You can decide ...
|
|
263 |
"/
|
10
|
264 |
"/ Color getColors6x6x4.
|
|
265 |
|
|
266 |
|
25
|
267 |
"/ The following loads some nice cursors; for example thumbsUp and thumbsDown
|
|
268 |
"/
|
|
269 |
"/ claus:
|
|
270 |
"/ I like those fancy cursors :-)
|
|
271 |
"/ if you think this is too 'childish', remove the line below ...
|
|
272 |
"/
|
|
273 |
"/
|
7
|
274 |
Smalltalk silentFileIn:'../goodies/Cursor-ST80Cursors.chg'.
|
10
|
275 |
|
25
|
276 |
|
|
277 |
"/ claus:
|
|
278 |
"/ I dont want those warnings about stx features being non-portable ...
|
|
279 |
"/ However, you should (at least when new to the system) see them.
|
|
280 |
"/ Once you get bored about them, make the below unconditional.
|
|
281 |
"/ (you can also turn them off in the NewLaunchers settings menu ...)
|
|
282 |
"/
|
7
|
283 |
OperatingSystem getLoginName = 'claus' ifTrue:[
|
12
|
284 |
Compiler warnSTXSpecials:false.
|
|
285 |
Compiler allowUnderscoreInIdentifier:true.
|
16
|
286 |
Compiler warnUnderscoreInIdentifier:false.
|
7
|
287 |
].
|
10
|
288 |
|
25
|
289 |
|
|
290 |
"/ this is a temporary kludge: specify the flags to be used
|
|
291 |
"/ when compiling via stc. Primitive compilation (from within the browser)
|
|
292 |
"/ is still experimental. So you better not care (yet)
|
|
293 |
"/ BTW: its only supported on UnixWare and SGI anyway
|
|
294 |
"/ (and not in the free demo release).
|
|
295 |
"/
|
|
296 |
Compiler stcCompilation:#default.
|
10
|
297 |
OperatingSystem getOSType = 'irix' ifTrue:[
|
|
298 |
Compiler stcCompilationFlags:'-I../../include +optinline -DGLX'.
|
|
299 |
] ifFalse:[
|
|
300 |
Compiler stcCompilationFlags:'-I../../include -I../../librun/VGL/vogl/src +optinline -DVGL'.
|
25
|
301 |
].
|
7
|
302 |
|
25
|
303 |
"/ experimental: try to always keep some bytes in the pocket
|
|
304 |
"/ this changes the memory policy, to start the background whenever
|
|
305 |
"/ freespace drops below 250k or 500k have been allocated since the last GC.
|
|
306 |
"/ AND to allocate more memory, if (after the collect) less than 1Mb is free.
|
|
307 |
"/ Doing so makes the system behave better if lots of memory is required
|
|
308 |
"/ for short periods of time, since it prepares itself for that
|
|
309 |
"/ during idle time. (I often walk around in the fileBrowser, loading big
|
|
310 |
"/ files like XWorkstation.st or SystemBrowser.st ....)
|
|
311 |
"/
|
|
312 |
"/ If you find this setup useful, remove the if, and make the
|
|
313 |
"/ statements in the block unconditional.
|
|
314 |
"/
|
16
|
315 |
OperatingSystem getLoginName = 'claus' ifTrue:[
|
17
|
316 |
ObjectMemory freeSpaceGCAmount:1000000.
|
|
317 |
ObjectMemory freeSpaceGCLimit:250000.
|
25
|
318 |
ObjectMemory incrementalGCLimit:500000.
|
16
|
319 |
ObjectMemory startBackgroundCollectorAt:5.
|
|
320 |
ObjectMemory startBackgroundFinalizationAt:5.
|
25
|
321 |
].
|
|
322 |
|
|
323 |
"/ experimental: configure the memory manager to quickly increase
|
|
324 |
"/ its oldSpace, as long as it stays below 8Mb (i.e. do not enter
|
|
325 |
"/ a blocking mark&sweep or compress, but go straight ahead increasing
|
|
326 |
"/ the oldSpace). Above that, behave as usual, i.e. try a GC first,
|
|
327 |
"/ then increase the oldSpace size if that did not help.
|
|
328 |
"/ If you have a machine with lots of (real) memory, you may want to
|
|
329 |
"/ increase the number. The value below should be ok for 16-32Mb machines.
|
|
330 |
"/
|
|
331 |
OperatingSystem getLoginName = 'claus' ifTrue:[
|
|
332 |
ObjectMemory fastMoreOldSpaceLimit:8*1024*1024.
|
|
333 |
ObjectMemory fastMoreOldSpaceAllocation:true.
|
|
334 |
].
|
16
|
335 |
!
|
|
336 |
|
25
|
337 |
"/ another experimental (and a secret for now, since I dont want
|
|
338 |
"/ you to play with those ;-)
|
|
339 |
"/ For now, this is experimental. Once the best numbers
|
|
340 |
"/ have been found, I'll hardwire them and document it ...
|
|
341 |
|
8
|
342 |
|a|
|
|
343 |
ObjectMemory newSpaceSize > (500*1024) ifTrue:[
|
|
344 |
a := #(nil nil nil nil -16 -4 -2 -2 0 0 16 nil) copy.
|
|
345 |
] ifFalse:[
|
17
|
346 |
"/ min max cpy /32 /16 /8 /4 /2 /4 /8 /16 /32 "
|
25
|
347 |
"/
|
|
348 |
"/ slow tenure - keeps objects longer in newSpace,
|
|
349 |
"/ producing more scavenge overhead, but releasing IGC somewhat
|
|
350 |
"/
|
17
|
351 |
"/ a := #(nil nil nil -100 -8 -4 -1 1 2 4 8 16 nil) copy.
|
|
352 |
"/ a := #(nil nil nil nil -16 -4 0 0 0 4 16 nil) copy.
|
25
|
353 |
|
17
|
354 |
"fast tenure"
|
25
|
355 |
"/
|
|
356 |
"/ fast tenure - moves objects earlier into oldSpace,
|
|
357 |
"/ releasing newSpace collector; however, the oldSpace IGC
|
|
358 |
"/ may have more work to do.
|
|
359 |
"/
|
16
|
360 |
a := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy.
|
8
|
361 |
].
|
|
362 |
ObjectMemory tenureParameters:a.
|
25
|
363 |
|
|
364 |
|
|
365 |
"/ set the package back to some useful default for programming
|
|
366 |
"/ this is the package token assigned (by default) to all new methods/classes
|
|
367 |
"/ (so you can use a browser on package=#private to find all of your new
|
|
368 |
"/ stuff easily. (the conditional on Project being nonNil is for stripped down
|
|
369 |
"/ systems without a Project class)
|
|
370 |
|
|
371 |
Project notNil ifTrue:[
|
|
372 |
Project setDefaultProject.
|
|
373 |
Project current packageName:#'private'.
|
|
374 |
].
|
8
|
375 |
!
|