smalltalk.rc
changeset 1561 6a5fa5c54b29
parent 1533 4ac01d754eec
child 1588 2727a9f4ac36
--- a/smalltalk.rc	Sat Jun 16 00:53:26 2018 +0200
+++ b/smalltalk.rc	Fri Jul 27 09:56:31 2018 +0200
@@ -665,77 +665,19 @@
     idx ~~ 0 ifTrue:[
 	Smalltalk commandLineArguments removeAtIndex: idx.
     ] ifFalse:[
-
 	'smalltalk.rc [info]: reading preferences ' infoPrint.
-	( AbortOperationRequest , TerminateProcessRequest , Parser parseErrorSignal ) handle:[:ex |
-	    'READ FAILED: ' errorPrint.
+	Error handle:[:ex |
+	    'FAILED: ' errorPrint.
 	    ex description errorPrintCR.
-	    ex return.
-	    1 halt.
+	    Smalltalk exit: 1.
 	] do:[
-	    "JV@2012-03-07: Try following settings files:
-	       $HOME/.smalltalk/settings.stx
-	       $HOME/.smalltalk/settings.rc
-	       $PWD/settings.stx
-	       $PWD/settings.rc
-
-	    in that order. Whichever is found, it is read and the rest
-	    is not used. Also, path to the file which has beed read is
-	    stored in 'UserPreferences current at:#settingsFilename'
-	    "
-	    | files continue |
-
-	    files := nil.
-
-	    idx := Smalltalk commandLineArguments indexOf: '--preferences'.
-	    idx ~~ 0 ifTrue:[
-		| file |
-
-		Smalltalk commandLineArguments size <= idx ifTrue:[
-		    '' errorPrintCR.
-		    'smalltalk.rc [error]: --preferences requires an argument, none given' errorPrintCR.
-		    Smalltalk exit: 1.
-		].
-		file := (Smalltalk commandLineArguments at: idx + 1) asFilename.
-		file exists ifFalse:[
-		    '' errorPrintCR.
-		    ('smalltalk.rc [error]: preference file ''', file pathName,''' does not exist') errorPrintCR.
-		    Smalltalk exit: 1.
-		].
-		file isDirectory ifTrue:[
-		    '' errorPrintCR.
-		    ('smalltalk.rc [error]: preference file ''', file pathName,''' is not a regular file') errorPrintCR.
-		    Smalltalk exit: 1.
-		].
-		file isReadable ifFalse:[
-		    '' errorPrintCR.
-		    ('smalltalk.rc [error]: preference file ''', file pathName,''' is not a readable (check permissions)') errorPrintCR.
-		    Smalltalk exit: 1.
-		].
-		files := Array with: file.
-		Smalltalk commandLineArguments removeAtIndex: idx + 1.
-		Smalltalk commandLineArguments removeAtIndex: idx.
+	    ( AbortOperationRequest , TerminateProcessRequest , Parser parseErrorSignal ) handle:[:ex |
+		'FAILED: ' errorPrint.
+		ex description errorPrintCR.
+		ex return.
+	    ] do:[
+		UserPreferences readSettingsFile.
 	    ].
-	    files isNil ifTrue:[
-		files := {
-			    (Filename homeDirectory / '.smalltalk' / 'settings.stx') . "/ per-user settings file (new default?)
-			    (Filename homeDirectory / '.smalltalk' / 'settings.rc') .  "/ for backward compatibility with jv-branch
-			    (Smalltalk getSystemFileName: 'settings.stx') .            "/ old stx default
-			    (Smalltalk getSystemFileName: 'settings.rc') .             "/ for backward compatibility with jv-branch
-			 }.
-	    ].
-	    continue := true.
-	    files do:[:each|
-		| eachFile |
-
-		(continue and:[each notNil and:[(eachFile := each asFilename) exists]]) ifTrue:[
-		    continue := false.
-		    eachFile pathName infoPrintCR.
-		    eachFile fileIn.
-		    UserPreferences current at:#settingsFilename put: eachFile pathName.
-		].
-	    ].
-	    continue ifTrue:[ '(none found)' infoPrintCR ].
 	].
     ].
 ].