A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1477.mcz
==================== Summary ====================
Name: Kernel-jar.1477
Author: jar
Time: 8 June 2022, 1:18:13.217988 pm
UUID: cde25b8e-8f6a-4241-8f6e-67a9ae27da68
Ancestors: Kernel-jar.1476
Setting suspendedContext may ruin your image; add checks to prevent such situations. Add examples and coments documenting disastrous situations.
Supersede Kernel-jar.1474.
Updated test will follow later.
=============== Diff against Kernel-jar.1476 ===============
Item was changed:
----- Method: Process>>suspendedContext: (in category 'private') -----
+ suspendedContext: aContextOrNil
+ "Set suspendedContext; proceed with caution when assigning nil or when process priority is undefined."
+
+ "Note: Assigning nil to a runnable but not active process would freeze the image when self is scheduled to run.
+
+ Workspace example:
+ These two lines (executed at once, not line by line)
+ p := [] newProcess resume.
+ p suspendedContext: nil
+ will freeze the image; the first line puts p in the run queue, the second line niles p's suspendedContext and
+ when the UI cycles, p tries to run with niled suspendedContext and the image freezes as a result.
+
+ Assigning 'suspendedContext' before 'priority' is defined may cause a disaster when Process Browser is open
+ with auto-update on; once the 'suspendedContext' is set, the new process is no longer considered terminated
+ and Process Browser will try to place it in its list of processes but encounters a nil error when reading its priority
+ because it has not been set yet.
+
+ Workspace example:
+ If you run the following line with Process Browser open and auto-update on, you'll ruin your image:
+ p := Process new suspendedContext: [self] asContext
+ Every second a new debugger window pops up and the only way out is to kill the image in the OS.
+
+ As a precautionary measure set 'priority' if undefined to the active process priority before setting
+ 'suspendedContext'."
- suspendedContext: aContext
- "Note: assigning nil to a runnable but not active process would freeze the image when self is scheduled to run."
+ priority ifNil: [priority := Processor activePriority].
+ suspendedContext := aContextOrNil ifNil: [self suspend. nil]!
- suspendedContext := aContext ifNil: [self suspend. nil]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2001.mcz
==================== Summary ====================
Name: Morphic-mt.2001
Author: mt
Time: 8 June 2022, 10:29:15.761735 am
UUID: 7a31acaf-9eb6-6244-8e53-0edd2be3d932
Ancestors: Morphic-mt.2000
Revise previous commit. Sorry for the noise.
=============== Diff against Morphic-mt.2000 ===============
Item was changed:
----- Method: LegacyShortcutsFilter class>>filterEvent:for: (in category 'event filter') -----
filterEvent: aKeyboardEvent for: textMorph
aKeyboardEvent isKeystroke ifFalse: [^ aKeyboardEvent].
aKeyboardEvent commandKeyPressed ifFalse: [^ aKeyboardEvent].
Preferences cmdKeysInText ifFalse: [^ aKeyboardEvent].
(Smalltalk platformName = 'Mac OS' and: [aKeyboardEvent shiftPressed])
ifTrue: ["Work around an issue in the VM where SHIFT is not honored
in the KeyChar event's character. This should only be the case for
KeyDown events to encode virtual-key presses. The VM should not
do this for KeyChar events. Works for U.S. keyboard layout only."
aKeyboardEvent keyValue: (
aKeyboardEvent keyCharacter caseOf: {
[$9] -> [$(]. [$0] -> [$)].
[$,] -> [$<]. [$.] -> [$>].
[$[] -> [${]. [$]] -> [$}].
[$'] -> [$"] }
otherwise: [aKeyboardEvent keyCharacter]) asInteger].
('()[]{}|''"<>' includes: aKeyboardEvent keyCharacter)
ifTrue: [textMorph
+ handleInteraction: [(textMorph editor enclose: aKeyboardEvent toggleOnly: true)
+ ifTrue: [aKeyboardEvent ignore]]
- handleInteraction: [(textMorph editor enclose: aKeyboardEvent) ifTrue: [aKeyboardEvent ignore]]
fromEvent: aKeyboardEvent].
^ aKeyboardEvent
"
Preferences cmdKeysInText
Preferences cmdGesturesEnabled
Preferences honorDesktopCmdKeys
PasteUpMorph globalCommandKeysEnabled.
"!
Item was changed:
Editor subclass: #TextEditor
instanceVariableNames: 'model paragraph markBlock pointBlock beginTypeInIndex emphasisHere lastParenLocation otherInterval oldInterval typeAhead history'
classVariableNames: 'AutoEnclose AutoIndent ChangeText EncloseSelection FindText InteractivePrintIt'
+ poolDictionaries: ''
- poolDictionaries: 'LegacyShortcutsFilter'
category: 'Morphic-Text Support'!
TextEditor class
instanceVariableNames: 'cmdActions shiftCmdActions yellowButtonMenu shiftedYellowButtonMenu'!
!TextEditor commentStamp: '<historical>' prior: 0!
See comment in Editor.
My instances edit Text, this is, they support multiple lines and TextAttributes.
They have no specific facilities for editing Smalltalk code. Those are found in SmalltalkEditor.!
TextEditor class
instanceVariableNames: 'cmdActions shiftCmdActions yellowButtonMenu shiftedYellowButtonMenu'!
Item was changed:
----- Method: TextEditor>>enclose: (in category 'editing keys') -----
enclose: aKeyboardEvent
+ ^ self enclose: aKeyboardEvent toggleOnly: false!
- ^ self enclose: aKeyboardEvent toggleOnly: LegacyShortcutsEnabled == true!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1355.mcz
==================== Summary ====================
Name: System-mt.1355
Author: mt
Time: 8 June 2022, 9:29:18.447101 am
UUID: fddf7561-4fb7-1a4d-9040-3007d78dedf2
Ancestors: System-mt.1354
Quickfix for making image-segment loading work again for image formats 68533 and 7033. See commentary.
=============== Diff against System-mt.1354 ===============
Item was changed:
----- Method: NativeImageSegment>>loadSegmentFrom:outPointers: (in category 'read/write segment primitives') -----
loadSegmentFrom: segmentWordArray outPointers: outPointerArray
"Load segmentWordArray into the memory. Adapt the primitive to the new API, which is to answer the array of loaded objects, the first of which should be the array of roots. The primitive will install a binary image segment and return as its value the array
of roots of the tree of objects represented. Upon successful completion, the
wordArray will have been becomed into anArray of the loaded objects. So simply answer the segmentWordArray which will have becommed."
| segmentFormat |
segmentFormat := self segmentFormatFrom: segmentWordArray first.
+ self flag: #discuss. "mt: Should the version for image segments consider or ignore that extra flag for multiple byte-code sets? See primitive 98 or #storeSegmentFor:into:outPointers:."
+ segmentFormat = (Smalltalk imageFormatVersion bitClear: 512 "MultipleBytecodeSetsBitmask") ifTrue:
- segmentFormat = Smalltalk imageFormatVersion ifTrue:
[^(self primitiveLoadSegmentFrom: segmentWordArray outPointers: outPointerArray)
ifNil: [self error: 'segment load failed']
ifNotNil: [segmentWordArray]].
segmentFormat >= 68000
ifTrue:
[Smalltalk wordSize = 4 ifTrue:
[^(Spur64BitImageSegmentLoader new loadSegmentFrom: segmentWordArray outPointers: outPointerArray)]]
ifFalse:
[Smalltalk wordSize = 8 ifTrue:
[^(Spur32BitImageSegmentLoader new loadSegmentFrom: segmentWordArray outPointers: outPointerArray)]].
self error: 'segment version unrecognized'!