--- a/ObjectMemory.st Wed Oct 28 18:31:21 2015 +0100
+++ b/ObjectMemory.st Wed Oct 28 18:49:09 2015 +0100
@@ -5565,13 +5565,23 @@
by '.chg', or, if not running from an image, the default name 'st.chg'.
However, it can be overwritten via the nameForChanges: setter"
- |nm|
-
- (nm := UserPreferences current changeFileName) notNil ifTrue:[
- ^ nm
+ |userPrefs localName nm wd|
+
+ localName := self nameForChangesLocal.
+ userPrefs := UserPreferences current.
+
+ "/ if the prefs provide a full, explicit name
+ (nm := userPrefs changeFileName) notNil ifTrue:[ ^ nm ].
+
+ "/ if there is a workspace, create it there
+ ((wd := userPrefs workspaceDirectory) notNil and:[wd exists]) ifTrue:[
+ ^ wd / (localName asFilename baseName)
].
+
+ "/ if it was set by a startup file
ChangeFileName notNil ifTrue:[^ ChangeFileName].
- ^ self nameForChangesLocal
+ "/ finally, fall back to a default.
+ ^ localName
"
ObjectMemory nameForChanges
@@ -5617,6 +5627,26 @@
This is the filename of the current image or,
if not running from an image, the default name 'st.img'"
+ |localName wd|
+
+ localName := self nameForSnapshotLocal.
+
+ "/ if there is a workspace, create it there
+ ((wd := UserPreferences current workspaceDirectory) notNil and:[wd exists]) ifTrue:[
+ ^ wd / (localName asFilename baseName)
+ ].
+ ^ localName
+
+ "
+ ObjectMemory nameForSnapshot
+ "
+!
+
+nameForSnapshotLocal
+ "return a reasonable filename to store the snapshot image into.
+ This is the filename of the current image or,
+ if not running from an image, the default name 'st.img'"
+
^ self imageBaseName , '.', self suffixForSnapshot
"