Dear Smalltalkers
I am pleased to announce new look of the Squeak Website
http://squeak.org
Personally, I want to thank Fabio Niephaus, who invested a lot
of effort into the new site.
Within the next week, the source for the site should be arrive
at our github organization[1] so that changes can be easily done
via pull requests.
Best regards
-Tobias
[1]: https://github.com/squeak-smalltalk/
I am having trouble using the "HT" version of the Spur VM under
daemontools. When the daemon attempts to launch the image it gets the
familiar pthread error:
pthread_setschedparam failed: Operation not permitted
Read e.g. http://www.mirandabanda.org/files/Cog/VM/VM.r3370/README.3370
however, I *definitely* have my /etc/security/limits.d/squeak.conf
file set up as instructed (been working fine for ages), and in fact
I'm able to run the same image with the same startup script under the
same uidgid manually. (e.g., I'm able to cut-n-paste the line from my
"run" script into the terminal and it works fine...)
exec setuidgid magma /usr/local/bin/spur -vm display=none
server-spur.image $DIR/run.st `cat port`
... but when daemontools runs it, gets the pthread error. Weird! Any ideas?
On Mon, 27 Apr 2015, commits(a)source.squeak.org wrote:
> Chris Muller uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-cmm.725.mcz
>
> ==================== Summary ====================
>
> Name: System-cmm.725
> Author: cmm
> Time: 27 April 2015, 3:20:18.66 pm
> UUID: b166e202-b3c3-4232-a17e-cd55a873fa50
> Ancestors: System-mt.724
>
> - Attempting to load preferences is blowing up, fix by restoring the old one-click behavior.
> - Proper fix for browsing allStoresInto: SomeClassVar from: aClassOrMetaclass, so that all stores occurring in either the instance or class side will be revealed even if the browse was initiated from the class-side.
>
> =============== Diff against System-mt.724 ===============
>
> Item was changed:
> ----- Method: Preferences class>>preferenceAt:ifAbsent: (in category 'preference-object access') -----
> preferenceAt: aSymbol ifAbsent: aBlock
> "Answer the Preference object at the given symbol, or the value of aBlock if not present"
>
> + ^self accessDictionaryOfPreferencesIn: [ :dictionaryOfPreferences |
> + dictionaryOfPreferences at: aSymbol ifAbsent: aBlock ]!
> - self accessDictionaryOfPreferencesIn: [ :dictionaryOfPreferences |
> - dictionaryOfPreferences
> - at: aSymbol
> - ifPresent: [ :preference | ^preference ] ].
> - ^aBlock value!
The above change restores the old behavior of locking up the image, so it
should be reverted. An additional comment explaininng why aBlock must
not be evaluated inside the argument of #accessDictionaryOfPreferencesIn:
would be helpful.
It would be even better to finally get rid of DictionaryOfPreferences.
Levente
Hi,
squeak.org\projects\ STEPS and Frank:
The last sentence lacks the e in the word one.
Noticed this on my mobile where it looks great too.
Is there a place other than the list to report these? Mantis?
Cheers,
Herbert
Eliot Miranda uploaded a new version of Services-Base to project The Inbox:
http://source.squeak.org/inbox/Services-Base-eem.56.mcz
==================== Summary ====================
Name: Services-Base-eem.56
Author: eem
Time: 30 June 2015, 3:34:50.838 pm
UUID: 2e8b9c56-6312-4a69-b65c-164ab583f617
Ancestors: Services-Base-mt.55
ServicePreferences as per System-eem.747. Move preferences dictionary from class var to inst var.
=============== Diff against Services-Base-mt.55 ===============
Item was added:
+ (PackageInfo named: 'Services-Base') preamble: '(Smalltalk classNamed: #ServicePreferences) ifNotNil:
+ [:sp|
+ (sp instVarNamed: ''preferencesDictionary'') ifNil:
+ [(sp classPool at: #ServiceDictionaryOfPreferences) ifNotNil:
+ [:dictionary|
+ sp
+ instVarNamed: ''preferencesDictionary''
+ put: dictionary]]]'!
Item was changed:
Preferences subclass: #ServicePreferences
instanceVariableNames: ''
+ classVariableNames: ''
- classVariableNames: 'ServiceDictionaryOfPreferences'
poolDictionaries: ''
category: 'Services-Base-GUI'!
!ServicePreferences commentStamp: 'rr 7/10/2006 15:36' prior: 0!
I store the preferences related to the servicse framework. The preferences are editable via the Services Browser, based on Hernan Tylim's Preference Browser.
The main preference categories for services are:
-- keyboard shortcuts -- : several text preferences, one per keyboard shortcuts. To edit them, enter a service identifier (equal to the method name under which it is defined in its ServiceProvider), and accept with alt-s or enter
-- menu contents -- : All the service categories in the image have a text preference under here. To edit it, enter the services identifiers you wish to put in this category, separating them with a single space character. The order is important: it defines the order of the items in menus.
-- settings -- : general boolean preferences.
Then there is a preference category for each provider in the image. Under each, you will find:
A boolean preference for each service in the image. If it is false, the service will not appear in menus.
The text preference for each service category defined by the service provider. This is the same as the one appearing in the menu contents preference category.!
Item was removed:
- ----- Method: ServicePreferences class>>dictionaryOfPreferences (in category 'accessing') -----
- dictionaryOfPreferences
- ServiceDictionaryOfPreferences
- ifNil: [ServiceDictionaryOfPreferences := IdentityDictionary new].
- ^ ServiceDictionaryOfPreferences !
Item was removed:
- ----- Method: ServicePreferences class>>dictionaryOfPreferences: (in category 'accessing') -----
- dictionaryOfPreferences: aDictionary
- ServiceDictionaryOfPreferences := aDictionary!
Item was changed:
----- Method: ServicePreferences class>>wipe (in category 'accessing') -----
wipe
+ preferencesDictionary := nil!
- self dictionaryOfPreferences: nil!
Eliot Miranda uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-eem.747.mcz
==================== Summary ====================
Name: System-eem.747
Author: eem
Time: 30 June 2015, 3:29:21.961 pm
UUID: b4f12663-36dd-4e16-9c83-5e446ea6e037
Ancestors: System-eem.746
Second part of putsch. Move preferences dictionary from class var to inst var. Remove the setter, and makde the getter, currently used only by SystemReporter, answer a copy.
=============== Diff against System-eem.746 ===============
Item was changed:
----- Method: Preferences class>>addPreference:categories:default:balloonHelp:projectLocal:changeInformee:changeSelector:type: (in category 'add preferences') -----
addPreference: aName categories: categoryList default: aValue balloonHelp: helpString projectLocal: localBoolean changeInformee: informeeSymbol changeSelector: aChangeSelector type: aType
"Add or replace a preference as indicated. Reuses the preexisting Preference object for this symbol, if there is one, so that UI artifacts that interact with it will remain valid."
| newPreference aPreference |
(newPreference := Preference new)
name: aName asSymbol
defaultValue: aValue
helpString: helpString
localToProject: localBoolean
categoryList: categoryList
changeInformee: informeeSymbol
changeSelector: aChangeSelector
type: aType.
+ aPreference := preferencesDictionary
- aPreference := DictionaryOfPreferences
at: newPreference name
ifAbsent: [newPreference].
aPreference == newPreference
ifTrue: "Atomically add the new preference to the dictionary."
[self atomicUpdatePreferences:
[:preferenceDictionaryCopy|
preferenceDictionaryCopy at: newPreference name put: newPreference]]
ifFalse: "Use the copyFrom: primitive to atomically update the existing preference."
[aPreference copyFrom: newPreference].
self compileAccessMethodForPreference: aPreference!
Item was changed:
----- Method: Preferences class>>allPreferenceObjects (in category 'preference-object access') -----
allPreferenceObjects
"Answer a list of all the Preference objects registered in the system"
+ ^preferencesDictionary values!
- ^DictionaryOfPreferences values!
Item was changed:
----- Method: Preferences class>>atomicUpdatePreferences: (in category 'accessing') -----
atomicUpdatePreferences: aBlock
"Evaluate aBlock with a copy of the preferences dictionary and
then assign (assignment is atomic) the copy to the dictionary."
+ | copyOfPreferences |
+ copyOfPreferences := preferencesDictionary
- | copyOfDictionaryOfPreferences |
- copyOfDictionaryOfPreferences := DictionaryOfPreferences
ifNil: [IdentityDictionary new]
ifNotNil: [:dict| dict copy].
+ aBlock value: copyOfPreferences.
+ preferencesDictionary := copyOfPreferences!
- aBlock value: copyOfDictionaryOfPreferences.
- DictionaryOfPreferences := copyOfDictionaryOfPreferences!
Item was changed:
----- Method: Preferences class>>dictionaryOfPreferences (in category 'accessing') -----
dictionaryOfPreferences
+ "N.B. Does /not/ answer the dictionary itself. To burrow that deep use e.g. instVarNamed:"
+ ^preferencesDictionary copy!
- "The use of this accessor doesn't ensure that the dictionary is not accessed concurrently. Use #accessDictionaryOfPreferencesIn: instead."
-
- ^DictionaryOfPreferences!
Item was removed:
- ----- Method: Preferences class>>dictionaryOfPreferences: (in category 'accessing') -----
- dictionaryOfPreferences: anObject
- DictionaryOfPreferences := anObject!
Item was changed:
----- Method: Preferences class>>initializeDictionaryOfPreferences (in category 'initialization') -----
initializeDictionaryOfPreferences
+ "Initialize the preferencesDictionary to be an empty IdentityDictionary"
- "Initialize the DictionaryOfPreferences to be an empty IdentityDictionary"
"Preferences initializeDictionaryOfPreferences"
+ preferencesDictionary := IdentityDictionary new!
- self dictionaryOfPreferences:IdentityDictionary new!
Item was changed:
----- Method: Preferences class>>inspectPreferences (in category 'preferences panel') -----
inspectPreferences
"Open a window on the current preferences dictionary, allowing the user to inspect and change the current preference settings. This is fallen back upon if Morphic is not present. This is dangerous, the dictionary of preferences should not be accessed concurrently."
"Preferences inspectPreferences"
+ preferencesDictionary inspectWithLabel: 'Preferences'!
- self dictionaryOfPreferences inspectWithLabel:'Preferences'!
Item was changed:
----- Method: Preferences class>>preferenceAt:ifAbsent: (in category 'preference-object access') -----
preferenceAt: aSymbol ifAbsent: aBlock
"Answer the Preference object at the given symbol, or the value of aBlock if not present"
+ ^preferencesDictionary at: aSymbol ifAbsent: aBlock!
- ^DictionaryOfPreferences at: aSymbol ifAbsent: aBlock!
Item was changed:
----- Method: Preferences class>>savePersonalPreferences (in category 'personalization') -----
savePersonalPreferences
"Save the current list of Preference settings as the user's personal choices"
self
setParameter: #PersonalDictionaryOfPreferences
+ to: preferencesDictionary deepCopy!
- to: DictionaryOfPreferences deepCopy!
Item was changed:
----- Method: Preferences class>>storePreferencesIn: (in category 'personalization') -----
storePreferencesIn: aFileName
| stream prefsSnapshot |
#(Prevailing PersonalPreferences) do:
[:ea |
Parameters removeKey: ea ifAbsent: []].
stream := ReferenceStream fileNamed: aFileName.
stream nextPut: Parameters.
+ prefsSnapshot := preferencesDictionary copy.
- prefsSnapshot := DictionaryOfPreferences copy.
prefsSnapshot keysAndValuesDo: [:key :pref | prefsSnapshot at: key put: pref asPreference].
stream nextPut: prefsSnapshot.
stream nextPut: (Smalltalk isMorphic
ifTrue:[World fillStyle]
ifFalse:[DesktopColor]).
stream close!
Item was changed:
(PackageInfo named: 'System') postscript: '" Convert SoundService registeredClasses to classes if necessary "
[ | currentSoundSystem |
currentSoundSystem := SoundService defaultOrNil.
(SoundService registeredClasses copy collect: [:ss |
SoundService unregister: ss.
ss isBehavior
ifTrue: [ss]
ifFalse: [ss class]]
) do: [:ssClass |
SoundService register: ssClass].
SoundService default: (currentSoundSystem
ifNotNil: [:css| css isBehavior ifTrue: [css] ifFalse: [css class]]).
] value.
"Convert preferences dictionary from class var to inst var if necessary."
(Preferences instVarNamed: ''preferencesDictionary'') ifNil:
[(Preferences classPool at: #DictionaryOfPreferences) ifNotNil:
[:dictionary|
Preferences
instVarNamed: ''preferencesDictionary''
+ put: dictionary]].
+
+ (Smalltalk classNamed: #ServicePreferences) ifNotNil:
+ [:sp|
+ (sp instVarNamed: ''preferencesDictionary'') ifNil:
+ [(sp classPool at: #ServiceDictionaryOfPreferences) ifNotNil:
+ [:dictionary|
+ sp
+ instVarNamed: ''preferencesDictionary''
+ put: dictionary]]]'!
- put: dictionary]]'!
Eliot Miranda uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-eem.746.mcz
==================== Summary ====================
Name: System-eem.746
Author: eem
Time: 30 June 2015, 3:17:33.999 pm
UUID: e08cd059-dc73-408a-b819-e40b840dda43
Ancestors: System-eem.745
First part of Preferences putsch to move preferences dictionary from class var to inst var. Also update class comment to describe preference pragmas.
=============== Diff against System-eem.745 ===============
Item was changed:
Object subclass: #Preferences
instanceVariableNames: ''
classVariableNames: 'DesktopColor DictionaryOfPreferences Parameters'
poolDictionaries: ''
category: 'System-Preferences'!
+ Preferences class
+ instanceVariableNames: 'preferencesDictionary'!
+ !Preferences commentStamp: 'eem 6/30/2015 15:10' prior: 0!
+ A general mechanism to store preference choices. The default setup treats any symbol as a potential boolean flag; flags unknown to the preference dictionary are always answered as false.
- !Preferences commentStamp: '<historical>' prior: 0!
- A general mechanism to store preference choices. The default setup treats any symbol as a potential boolean flag; flags unknown to the preference dictionary are always returned as false.
+ To open the control panel:
+ PreferenceBrowser open
- To open the control panel: Preferences openFactoredPanel
To read how to use the panel (and how to make a preference be per-project):
Preferences giveHelpWithPreferences
+ All messages are on the class side. There are two kinds of preference definition, preference pragmas (which are preferred) and preferences local to Preferences.
- All messages are on the class side.
+ Preference Pragmas
+ Preferences can be local to a class or system of classes using preference pragmas. Look at senders of #preference:category:description:type: and #preference:categoryList:description:type: for examples:
+ (self systemNavigation browseAllSelect:
+ [:m|
+ #(preference:category:description:type: preference:categoryList:description:type:) anySatisfy:
+ [:s| (m pragmaAt: s) notNil]])
+ With a preference pragma, the preference is typically kept in a class variable, local to the class whose method(s) contain(s) the pragma. Good style is to put the preference pragma in the accessor for the variable; see for example BitBlt class>>#subPixelRenderColorFonts. The pragma serves to declare the preference to Preferences.
+
+
+ Preference-local Preferences
To query a a preference:
Preferences logDebuggerStackToFile
or some people prefer the more verbose
Preferences valueOfFlag: #logDebuggerStackToFile
+ You can make up a new preference any time. Do not define a new message in Preferences class. Accessor methods are compiled automatically when you add a preference, either as as illustrated below, or by using
- You can make up a new preference any time. Do not define a new message in Preferences class. Accessor methods are compiled automatically when you add a preference as illustrated below:
+ To add a non-pragma preference (e.g. in the Postscript of a fileout):
+ Preferences
+ addPreference: #samplePreference
+ categories: #(general browsing)
+ default: true
+ balloonHelp: 'This is an example of a preference added by a do-it'
+ projectLocal: false
+ changeInformee: nil
+ changeSelector: nil.
- To add a preference (e.g. in the Postscript of a fileout):
- Preferences addPreference: #samplePreference categories: #(general browsing)
- default: true balloonHelp: 'This is an example of a preference added by a do-it'
- projectLocal: false changeInformee: nil changeSelector: nil.
To change a preference programatically:
Preferences disable: #logDebuggerStackToFile.
Or to turn it on,
Preferences enable: #logDebuggerStackToFile.
!
+ Preferences class
+ instanceVariableNames: 'preferencesDictionary'!
Item was changed:
(PackageInfo named: 'System') postscript: '" Convert SoundService registeredClasses to classes if necessary "
[ | currentSoundSystem |
currentSoundSystem := SoundService defaultOrNil.
(SoundService registeredClasses copy collect: [:ss |
SoundService unregister: ss.
ss isBehavior
ifTrue: [ss]
ifFalse: [ss class]]
) do: [:ssClass |
SoundService register: ssClass].
SoundService default: (currentSoundSystem
ifNotNil: [:css| css isBehavior ifTrue: [css] ifFalse: [css class]]).
+ ] value.
+
+ "Convert preferences dictionary from class var to inst var if necessary."
+ (Preferences instVarNamed: ''preferencesDictionary'') ifNil:
+ [(Preferences classPool at: #DictionaryOfPreferences) ifNotNil:
+ [:dictionary|
+ Preferences
+ instVarNamed: ''preferencesDictionary''
+ put: dictionary]]'!
- ] value'!