Smalltalk.st
changeset 13814 3d547c0d4634
parent 13787 1695a24d0fa7
child 13850 a6140722f613
--- a/Smalltalk.st	Thu Nov 03 21:32:58 2011 +0100
+++ b/Smalltalk.st	Fri Nov 04 13:46:27 2011 +0100
@@ -68,123 +68,127 @@
 
 
     [Instance variables:]
-					none - all handling is done in the VM
+                                        none - all handling is done in the VM
 
     [Class variables:]
 
-	StartBlocks     <Collection>    blocks to be executed in a separate process after
-					everything has been initialized. These blocks will
-					be deleted after execution and therefore not be
-					executed after an image restart. Initial processes
-					(such as the Launcher) are usually started here.
-					These blocks are added by smalltalk.rc/private.rc etc.
-					via #addStartBlock during early initialization.
-
-	ImageStartBlocks
-			<Collection>    blocks to be executed in a separate process after
-					everything has been initialized. These blocks will be
-					executed after an image restart.
-					These blocks are usually added by smalltalk_r.rc etc.
-
-	ExitBlocks      <Collection>    blocks to evaluate before system is
-					left. Not currently used (GNU-ST compatibility).
-
-	SystemPath      <Collection>    path to search for system files (sources, bitmaps etc)
-					Set to a default here, but typically changed from some
-					startup.rc file
-
-	PackagePath     <Collection>    path to search for package.
-					This is going to replace the above systemPath, and a classes
-					resources will eventually searched in its package directory.
-					This list defines the path, where packages are searched for,
-					initially this is something like /opt/smalltalk/packages.
-					Set to a default here, but typically changed from some
-					startup.rc file
-
-	StartupClass    <Class>         class and selector, where the system starts up
-	StartupSelector <Symbol>        (right after VM initialization)
-	StartupArguments <Array>        If an image is saved while those being nonNil,
-					the image will come up there.
-					Allows for customized images to be generated from a standard ST/X.
-					StandAlone programs also set those during initialization.
-
-	CommandLine          <String>   Unix (OS-) command line
-
-	CommandName          <String>   the command (i.e. argv[0])
-
-	CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
-					CommandName has been stripped off.
-					(initially set by the VM)
-
-	SilentLoading   <Boolean>       suppresses messages during fileIn and in compiler
-					(can be set to true from a customized main.c)
-
-	Initializing    <Boolean>       true while (re-)initializing
-					Controls the behavior of certain error
-					reporters (for example: suppress dialogBoxes)
-					while the system is not yet fit for full operation.
-
-	StandAlone      <Boolean>       true, if this is a standalone app;
-					if true the process scheduler watches for
-					which processes are still running, and
-					exits ST/X, when the last non-background
-					and non-system process exits.
-					Can be set in an application-specific startup script,
-					or, for standAlone programs, by C-code during initialization.
-
-	HeadlessOperation               if true, a non-existing Display connection
-			<Boolean>       will NOT lead to an error-exit during startup.
-					Default is false.
-					Can be set in an application-specific startup script,
-					or, for standAlone programs, by C-code during initialization.
-
-	LogDoits        <Boolean>       if true, doits are also logged in the changes
-					file. Default is false, since the changes file
-					may become huge if every tiny doIt is saved there ...
-
-	LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
-					file, if present. If false, this is always suppressed.
-
-	SaveEmergencyImage <Boolean>    if true (the default), an emergency image
-					is saved, if the main Display looses its
-					connection. This is useful if you have a
-					flaky display connection (serial line)
-					and want to have your stuff saved automatically
-					in case of a broken connection.
+        StartBlocks     <Collection>    blocks to be executed in a separate process after
+                                        everything has been initialized. These blocks will
+                                        be deleted after execution and therefore not be
+                                        executed after an image restart. Initial processes
+                                        (such as the Launcher) are usually started here.
+                                        These blocks are added by smalltalk.rc/private.rc etc.
+                                        via #addStartBlock during early initialization.
+
+        ImageStartBlocks
+                        <Collection>    blocks to be executed in a separate process after
+                                        everything has been initialized. These blocks will be
+                                        executed after an image restart.
+                                        These blocks are usually added by smalltalk_r.rc etc.
+
+        ExitBlocks      <Collection>    blocks to evaluate before system is
+                                        left. Not currently used (GNU-ST compatibility).
+
+        SystemPath      <Collection>    path to search for system files (sources, bitmaps etc)
+                                        Set to a default here, but typically changed from some
+                                        startup.rc file
+
+        PackagePath     <Collection>    path to search for package.
+                                        This is going to replace the above systemPath, and a classes
+                                        resources will eventually searched in its package directory.
+                                        This list defines the path, where packages are searched for,
+                                        initially this is something like /opt/smalltalk/packages.
+                                        Set to a default here, but typically changed from some
+                                        startup.rc file
+
+        StartupClass    <Class>         class and selector, where the system starts up
+        StartupSelector <Symbol>        (right after VM initialization)
+        StartupArguments <Array>        If an image is saved while those being nonNil,
+                                        the image will come up there.
+                                        Allows for customized images to be generated from a standard ST/X.
+                                        StandAlone programs also set those during initialization.
+
+        CommandLine          <String>   Unix (OS-) command line
+
+        CommandName          <String>   the command (i.e. argv[0])
+
+        CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
+                                        CommandName has been stripped off.
+                                        (initially set by the VM)
+
+        SilentLoading   <Boolean>       OBSOLETE:
+                                        suppresses messages during fileIn and in compiler
+                                        (can be set to true from a customized main.c)
+
+        VerboseLoading   <Boolean>      generate messages during fileIn and in compiler
+                                        (can be set to true from a customized main.c)
+
+        Initializing    <Boolean>       true while (re-)initializing
+                                        Controls the behavior of certain error
+                                        reporters (for example: suppress dialogBoxes)
+                                        while the system is not yet fit for full operation.
+
+        StandAlone      <Boolean>       true, if this is a standalone app;
+                                        if true the process scheduler watches for
+                                        which processes are still running, and
+                                        exits ST/X, when the last non-background
+                                        and non-system process exits.
+                                        Can be set in an application-specific startup script,
+                                        or, for standAlone programs, by C-code during initialization.
+
+        HeadlessOperation               if true, a non-existing Display connection
+                        <Boolean>       will NOT lead to an error-exit during startup.
+                                        Default is false.
+                                        Can be set in an application-specific startup script,
+                                        or, for standAlone programs, by C-code during initialization.
+
+        LogDoits        <Boolean>       if true, doits are also logged in the changes
+                                        file. Default is false, since the changes file
+                                        may become huge if every tiny doIt is saved there ...
+
+        LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
+                                        file, if present. If false, this is always suppressed.
+
+        SaveEmergencyImage <Boolean>    if true (the default), an emergency image
+                                        is saved, if the main Display looses its
+                                        connection. This is useful if you have a
+                                        flaky display connection (serial line)
+                                        and want to have your stuff saved automatically
+                                        in case of a broken connection.
 
     strictly private classVariables (helpers):
 
-	CachedClasses   <Collection>    known classes (cached for faster class enumeration)
-
-	CachedAbbreviations
-			<Dictionary>    className to filename mappings
-
-	RealSystemPath  <Collection>    cached collection of directories along the path
-					which really exist. Caching avoids long checks
-					for existing directories on broken NFS volumes.
-
-	SourcePath      <Collection>    cached names of really existing directories
-					These are remembered, as in NFS systems,
-	ResourcePath                    the time to lookup files may become long
-	BinaryPath                      (especially, if some directories are on machines
-	FileInPath                      which are not up ...).
-					Therefore, the set of really
-					existing directories is cached when the SystemPath
-					is walked the first time.
-					A consequence is that you have to invoke
-					flushSystemPath, when you create any of those
-					directories while running
-					(and want the running ST/X to look there)
+        CachedClasses   <Collection>    known classes (cached for faster class enumeration)
+
+        CachedAbbreviations
+                        <Dictionary>    className to filename mappings
+
+        RealSystemPath  <Collection>    cached collection of directories along the path
+                                        which really exist. Caching avoids long checks
+                                        for existing directories on broken NFS volumes.
+
+        SourcePath      <Collection>    cached names of really existing directories
+                                        These are remembered, as in NFS systems,
+        ResourcePath                    the time to lookup files may become long
+        BinaryPath                      (especially, if some directories are on machines
+        FileInPath                      which are not up ...).
+                                        Therefore, the set of really
+                                        existing directories is cached when the SystemPath
+                                        is walked the first time.
+                                        A consequence is that you have to invoke
+                                        flushSystemPath, when you create any of those
+                                        directories while running
+                                        (and want the running ST/X to look there)
 
 
     [author:]
-	Claus Gittinger
+        Claus Gittinger
 
     [see also:]
-	ObjectMemory
-	StandaloneStartup
-	GetOpt
-	ReadEvalPrintLoop
+        ObjectMemory
+        StandaloneStartup
+        GetOpt
+        ReadEvalPrintLoop
 "
 !
 
@@ -2211,10 +2215,10 @@
     packageDirName := self getPackageFileName:packageDirName.
 
     (packageDirName notNil and:[Class tryLocalSourceFirst]) ifTrue:[
-	(self loadExtensionsFromDirectory:packageDirName language: language) ifTrue:[
-	    ^ true.
-	].
-	packageDirName := nil.  "do not try again"
+        (self loadExtensionsFromDirectory:packageDirName language: language) ifTrue:[
+            ^ true.
+        ].
+        packageDirName := nil.  "do not try again"
     ].
 
     "
@@ -2222,50 +2226,50 @@
     "
     mgr := Smalltalk at:#SourceCodeManager.
     mgr notNil ifTrue:[
-	extensionsFilename := 'extensions.' , language sourceFileSuffix.
-
-	projectDefinition := ProjectDefinition definitionClassForPackage:aPackageId.
-	projectDefinition notNil ifTrue:[
-	    mod := aPackageId asPackageId module.
-	    dir := aPackageId asPackageId directory.
-	    extensionsRevisionString := projectDefinition perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
-	    extensionsRevisionString notNil ifTrue:[
-		extensionsRevisionInfo := mgr revisionInfoFromString:extensionsRevisionString inClass:nil.
-		extensionsRevisionInfo notNil ifTrue:[
-		    extensionsRevisionInfo fileName = extensionsFilename ifFalse:[^ false].
-		]
-	    ].
-	    SourceCodeManagerError handle:[:ex |
-	    ] do:[
-		inStream := mgr streamForExtensionFile:extensionsFilename package:aPackageId directory:dir module:mod cache:true.
-	    ].
-	].
-	inStream isNil ifTrue:[
-	    SourceCodeManagerError handle:[:ex |
-	    ] do:[
-		inStream := mgr getMostRecentSourceStreamForFile:extensionsFilename inPackage:aPackageId.
-	    ].
-	].
-	inStream notNil ifTrue:[
-	    Class withoutUpdatingChangeSetDo:[
-		inStream fileIn.
-	    ].
-	    inStream close.
-	    SilentLoading ifFalse:[
-		Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
-	    ].
-	    ^ true
-	]
+        extensionsFilename := 'extensions.' , language sourceFileSuffix.
+
+        projectDefinition := ProjectDefinition definitionClassForPackage:aPackageId.
+        projectDefinition notNil ifTrue:[
+            mod := aPackageId asPackageId module.
+            dir := aPackageId asPackageId directory.
+            extensionsRevisionString := projectDefinition perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
+            extensionsRevisionString notNil ifTrue:[
+                extensionsRevisionInfo := mgr revisionInfoFromString:extensionsRevisionString inClass:nil.
+                extensionsRevisionInfo notNil ifTrue:[
+                    extensionsRevisionInfo fileName = extensionsFilename ifFalse:[^ false].
+                ]
+            ].
+            SourceCodeManagerError handle:[:ex |
+            ] do:[
+                inStream := mgr streamForExtensionFile:extensionsFilename package:aPackageId directory:dir module:mod cache:true.
+            ].
+        ].
+        inStream isNil ifTrue:[
+            SourceCodeManagerError handle:[:ex |
+            ] do:[
+                inStream := mgr getMostRecentSourceStreamForFile:extensionsFilename inPackage:aPackageId.
+            ].
+        ].
+        inStream notNil ifTrue:[
+            Class withoutUpdatingChangeSetDo:[
+                inStream fileIn.
+            ].
+            inStream close.
+            VerboseLoading ifTrue:[
+                Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
+            ].
+            ^ true
+        ]
     ].
 
     packageDirName notNil ifTrue:[
-	^ self loadExtensionsFromDirectory:packageDirName language: language
+        ^ self loadExtensionsFromDirectory:packageDirName language: language
     ].
     ^ false
 
     "Created: / 02-01-2010 / 10:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 19-03-2011 / 10:03:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 04-09-2011 / 09:30:22 / cg"
+    "Modified: / 04-11-2011 / 13:41:29 / cg"
 !
 
 loadExtensionsFromDirectory:packageDirOrString
@@ -2287,17 +2291,18 @@
 
     f := packageDir / ('extensions.' , language sourceFileSuffix).
     f exists ifTrue:[
-	Class withoutUpdatingChangeSetDo:[
-	    f fileIn.
-	].
-	SilentLoading ifFalse:[
-	    Transcript showCR:('loaded extensions: ' , f pathName).
-	].
-	^ true
+        Class withoutUpdatingChangeSetDo:[
+            f fileIn.
+        ].
+        VerboseLoading ifTrue:[
+            Transcript showCR:('loaded extensions: ' , f pathName).
+        ].
+        ^ true
     ].
     ^ false
 
     "Created: / 02-01-2010 / 10:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-11-2011 / 13:41:19 / cg"
 !
 
 loadPackage:aPackageString asAutoloaded:doLoadAsAutoloaded
@@ -2699,17 +2704,17 @@
     Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
 
     doLoadAsAutoloaded ifFalse:[
-	"/ force autoloading...
-	Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
+        "/ force autoloading...
+        Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
     ].
 
     self loadExtensionsFromDirectory:packageDir.
-    SilentLoading ifFalse:[
-	Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
+    VerboseLoading ifTrue:[
+        Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
     ].
     ^ true
 
-    "Modified: / 10-08-2006 / 12:17:57 / cg"
+    "Modified: / 04-11-2011 / 13:43:29 / cg"
 ! !
 
 !Smalltalk class methodsFor:'queries'!
@@ -5341,9 +5346,9 @@
     (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
     ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
     ok ifTrue:[
-	SilentLoading ifFalse:[
-	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
-	]
+        VerboseLoading ifTrue:[
+            Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
+        ]
     ].
     ^ ok
 
@@ -5352,7 +5357,7 @@
      Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so'
     "
 
-    "Modified: 10.9.1996 / 20:43:52 / cg"
+    "Modified: / 04-11-2011 / 13:42:24 / cg"
 !
 
 fileInClass:aClassName initialize:doInit
@@ -7683,11 +7688,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.979 2011-10-07 22:08:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.980 2011-11-04 12:46:27 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.979 2011-10-07 22:08:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.980 2011-11-04 12:46:27 cg Exp $'
 !
 
 version_SVN