Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1126.mcz
==================== Summary ====================
Name: System-mt.1126
Author: mt
Time: 4 December 2019, 10:33:06.353613 am
UUID: 396886fd-6463-4b06-9414-b972caa1ac4d
Ancestors: System-tpr.1125
Makes the title of access browsers more readable.
=============== Diff against System-tpr.1125 ===============
Item was changed:
----- Method: SystemNavigation>>browseAllAccessesTo:from: (in category 'browse') -----
browseAllAccessesTo: instVarName from: aClass
"Create and schedule a Message Set browser for all the receiver's methods or any methods of a subclass/superclass that refer to the instance variable name."
"self new browseAllAccessesTo: 'contents' from: Collection."
^ self
browseMessageList: [ (self allAccessesTo: instVarName from: aClass) sort ]
+ name: ('Accesses to {1} from {2}' translated format: {instVarName. aClass name})
- name: 'Accesses to ' , instVarName
autoSelect: instVarName!
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.246.mcz
==================== Summary ====================
Name: ST80-mt.246
Author: mt
Time: 4 December 2019, 10:32:14.954613 am
UUID: 7435a337-bf82-46b4-b44d-de17edd88aae
Ancestors: ST80-jr.245
Replicates the functionality as of Morphic-mt.1599 regarding "senders of it" and "references to it".
=============== Diff against ST80-jr.245 ===============
Item was changed:
----- Method: ParagraphEditor>>lineSelectAndEmptyCheck: (in category 'menu messages') -----
lineSelectAndEmptyCheck: returnBlock
"If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectLine.
+ self hasSelection ifFalse: [
+ self flash.
+ ^ returnBlock value]].!
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [self flash. ^ returnBlock value]!
Item was changed:
----- Method: ParagraphEditor>>referencesToIt (in category 'menu messages') -----
referencesToIt
+ "Open a MessageSet with the references to the selected global or variable name."
- "Open a references browser on the selected symbol"
+ self wordSelectAndEmptyCheck: [^ self].
+ self selectedInstanceVariable ifNotNil:
+ [:nameToClass | ^ self terminateAndInitializeAround:
+ [self systemNavigation
+ browseAllAccessesTo: nameToClass key
+ from: nameToClass value]].
+ self selectedBinding ifNotNil:
+ [:binding | ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOnClass: binding]].
+ view flash.!
- | aSymbol |
- self selectLine.
- ((aSymbol := self selectedSymbol) == nil or:
- [(Smalltalk globals includesKey: aSymbol) not])
- ifTrue: [^ view flash].
-
- self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: (Smalltalk globals associationAt: self selectedSymbol)]!
Item was changed:
----- Method: ParagraphEditor>>selectLine (in category 'new selection') -----
selectLine
"Make the receiver's selection, if it currently consists of an insertion point only, encompass the current line."
+
- self hasSelection ifTrue:[^self].
self selectInterval: (self encompassLine: self selectionInterval)!
Item was added:
+ ----- Method: ParagraphEditor>>selectedBinding (in category 'menu messages') -----
+ selectedBinding
+ "Try to make a binding out of the current text selection. That binding can be a global or class."
+
+ ^ self selectedSymbol ifNotNil:
+ [ :symbol |
+ ((model respondsTo: #selectedClassOrMetaClass)
+ ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
+ ifFalse: [ model environment ]) ifNotNil:
+ [ :environment | environment bindingOf: symbol ] ]!
Item was added:
+ ----- Method: ParagraphEditor>>selectedInstanceVariable (in category 'menu messages') -----
+ selectedInstanceVariable
+ "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes."
+
+ (model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+
+ ^ self selection string ifNotNil:
+ [ :token | model selectedClassOrMetaClass ifNotNil:
+ [ :behavior |
+ (behavior instVarIndexFor: token ifAbsent: [ 0 ]) ~= 0
+ ifTrue: [ token -> behavior ]
+ ifFalse: [ nil ] ] ]!
Item was added:
+ ----- Method: ParagraphEditor>>selectedLiteral (in category 'menu messages') -----
+ selectedLiteral
+ "Try to make a Smalltalk literal out of the current text selection."
+
+ ^ self selection string findLiteral!
Item was changed:
----- Method: ParagraphEditor>>selectedSymbol (in category 'menu messages') -----
selectedSymbol
+ "Try to make a symbol out of the current text selection."
- "Return the currently selected symbol, or nil if none. Spaces, tabs and returns are ignored"
+ ^ self selection string findSymbol!
- | aString |
- self hasCaret ifTrue: [^ nil].
- aString := self selection string.
- aString isOctetString ifTrue: [aString := aString asOctetString].
- aString := self selection string copyWithoutAll: CharacterSet separators.
- aString size = 0 ifTrue: [^ nil].
- Symbol hasInterned: aString ifTrue: [:sym | ^ sym].
-
- ^ nil!
Item was changed:
----- Method: ParagraphEditor>>sendersOfIt (in category 'menu messages') -----
sendersOfIt
"Open a senders browser on the selected selector"
- | aSelector |
self lineSelectAndEmptyCheck: [^ self].
+ self selectedSelector ifNotNil:
+ [:aSelector| ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOn: aSelector]].
+ self selectedLiteral ifNotNil:
+ [:aLiteral| ^ self terminateAndInitializeAround:
+ [self systemNavigation browseAllCallsOn: aLiteral]].
+ view flash!
- (aSelector := self selectedSelector) == nil ifTrue: [^ view flash].
- self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: aSelector]!
Item was added:
+ ----- Method: ParagraphEditor>>wordSelectAndEmptyCheck: (in category 'menu messages') -----
+ wordSelectAndEmptyCheck: returnBlock
+ "If the current selection is an insertion point, expand it to be the entire current word; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+
+ self hasSelection ifFalse: [
+ self selectWord.
+ self hasSelection ifFalse: [
+ self flash.
+ ^ returnBlock value]].!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1599.mcz
==================== Summary ====================
Name: Morphic-mt.1599
Author: mt
Time: 4 December 2019, 10:30:59.590613 am
UUID: e0afb7cd-2598-4ec8-b31c-d011525ddee9
Ancestors: Morphic-mt.1598
Makes #referencesToIt as readable as #sendersOfIt. Removes some code duplication -- yeah, Editor is still kind of abstract and fails to document its interface property, i.e., #selectLine, ... so much to do! :-)
=============== Diff against Morphic-mt.1598 ===============
Item was changed:
----- Method: Editor>>lineSelectAndEmptyCheck: (in category 'menu messages') -----
lineSelectAndEmptyCheck: returnBlock
"If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectLine.
+ self hasSelection ifFalse: [
+ morph flash.
+ ^ returnBlock value]].!
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was changed:
----- Method: Editor>>wordSelectAndEmptyCheck: (in category 'menu messages') -----
wordSelectAndEmptyCheck: returnBlock
"Ensure selecting the entire current word; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
+ self hasSelection ifFalse: [
+ self selectWord.
+ self hasSelection ifFalse: [
+ morph flash.
+ ^ returnBlock value]].!
- self selectWord. "Select exactly a whole word"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was removed:
- ----- Method: TextEditor>>lineSelectAndEmptyCheck: (in category 'new selection') -----
- lineSelectAndEmptyCheck: returnBlock
- "If the current selection is an insertion point, expand it to be the entire current line; if after that's done the selection is still empty, then evaluate the returnBlock, which will typically consist of '[^ self]' in the caller -- check senders of this method to understand this."
-
- self selectLine. "if current selection is an insertion point, then first select the entire line in which occurs before proceeding"
- self hasSelection ifFalse: [morph flash. ^ returnBlock value]!
Item was changed:
----- Method: TextEditor>>referencesToIt (in category 'menu messages') -----
referencesToIt
"Open a MessageSet with the references to the selected global or variable name."
+
+ self wordSelectAndEmptyCheck: [^ self].
+ self selectedInstanceVariable ifNotNil:
+ [:nameToClass | ^ self systemNavigation
+ browseAllAccessesTo: nameToClass key
+ from: nameToClass value].
+ self selectedBinding ifNotNil:
+ [:binding | ^ self systemNavigation browseAllCallsOnClass: binding].
+ morph flash.!
- | selection environment binding |
- self selection isEmpty ifTrue: [ self selectWord ].
- environment := (model respondsTo: #selectedClassOrMetaClass)
- ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
- ifFalse: [ model environment ].
- selection := self selectedSymbol ifNil: [ self selection asString ].
- (environment isBehavior and:
- [ (environment
- instVarIndexFor: selection
- ifAbsent: [ 0 ]) ~= 0 ]) ifTrue: [ ^ self systemNavigation
- browseAllAccessesTo: selection
- from: environment ].
- selection isSymbol ifFalse: [ ^ morph flash ].
- binding := (environment bindingOf: selection) ifNil: [ ^ morph flash ].
-
- self systemNavigation browseAllCallsOnClass: binding.!
Item was changed:
----- Method: TextEditor>>selectLine (in category 'new selection') -----
selectLine
"Make the receiver's selection, if it currently consists of an insertion point only, encompass the current line."
+
- self hasSelection ifTrue:[^self].
self selectInterval: (self encompassLine: self selectionInterval)!
Item was added:
+ ----- Method: TextEditor>>selectedBinding (in category 'menu messages') -----
+ selectedBinding
+ "Try to make a binding out of the current text selection. That binding can be a global or class."
+
+ ^ self selectedSymbol ifNotNil:
+ [ :symbol |
+ ((model respondsTo: #selectedClassOrMetaClass)
+ ifTrue: [ model selectedClassOrMetaClass ifNil: [ model environment ] ]
+ ifFalse: [ model environment ]) ifNotNil:
+ [ :environment | environment bindingOf: symbol ] ]!
Item was added:
+ ----- Method: TextEditor>>selectedInstanceVariable (in category 'menu messages') -----
+ selectedInstanceVariable
+ "Try to make an association from an instance-variable name to the class where this variable is defined. Make the implementation robust for models that do not know about classes."
+
+ (model respondsTo: #selectedClassOrMetaClass) ifFalse: [ ^ nil ].
+
+ ^ self selection string ifNotNil:
+ [ :token | model selectedClassOrMetaClass ifNotNil:
+ [ :behavior |
+ (behavior instVarIndexFor: token ifAbsent: [ 0 ]) ~= 0
+ ifTrue: [ token -> behavior ]
+ ifFalse: [ nil ] ] ]!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.866.mcz
==================== Summary ====================
Name: Collections-mt.866
Author: mt
Time: 3 December 2019, 2:05:26.496677 pm
UUID: d4ee3e01-f703-8b47-88e2-5c3d52dbaf11
Ancestors: Collections-cmm.865
Complements Morphic-mt.1598 to bring all those find*-parsing methods together. We might want to put it into an extension category? Maybe "*Tools-converting"?
=============== Diff against Collections-cmm.865 ===============
Item was added:
+ ----- Method: String>>findLiteral (in category 'converting') -----
+ findLiteral
+ "Scan the receiver for tokens that represent Smalltalk code literals. Return the first token or nil if non were found."
+
+ | tokens |
+ tokens := Scanner new typedScanTokens: self.
+ ^tokens isEmpty ifFalse: [tokens first]!
Item was added:
+ ----- Method: String>>findSymbol (in category 'converting') -----
+ findSymbol
+ "Return the currently selected symbol, or nil if none. Spaces, tabs and returns are ignored. Note that we do never return the empty symbol."
+
+ | aString |
+ aString := self copyWithoutAll: CharacterSet separators.
+ aString size = 0 ifTrue: [^ nil].
+ ^ Symbol lookup: aString!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1598.mcz
==================== Summary ====================
Name: Morphic-mt.1598
Author: mt
Time: 3 December 2019, 2:02:47.214677 pm
UUID: 8ee5a31c-f69f-6049-b274-c3dcbbdec38e
Ancestors: Morphic-eem.1597
Harmonize all find*-parsing methods used in text editors.
=============== Diff against Morphic-eem.1597 ===============
Item was changed:
----- Method: TextEditor>>selectedLiteral (in category 'menu messages') -----
selectedLiteral
+ "Try to make a Smalltalk literal out of the current text selection."
+
+ ^ self selection string findLiteral!
- "Try to make a literal out of the current text selection"
- | tokens |
- tokens := Scanner new typedScanTokens: self selection string.
- ^tokens isEmpty ifFalse: [tokens first]!
Item was changed:
----- Method: TextEditor>>selectedSelector (in category 'menu messages') -----
selectedSelector
+ "Try to make a selector out of the current text selection."
+
+ ^ self selection string findSelector!
- "Try to make a selector out of the current text selection"
- ^self selection string findSelector!
Item was changed:
----- Method: TextEditor>>selectedSymbol (in category 'menu messages') -----
selectedSymbol
+ "Try to make a symbol out of the current text selection."
- "Return the currently selected symbol, or nil if none. Spaces, tabs and returns are ignored"
+ ^ self selection string findSymbol!
- | aString |
- self hasCaret ifTrue: [^ nil].
- aString := self selection string copyWithoutAll: CharacterSet separators.
- aString size = 0 ifTrue: [^ nil].
- Symbol hasInterned: aString ifTrue: [:sym | ^ sym].
-
- ^ nil!
tim Rowledge uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-tpr.238.mcz
==================== Summary ====================
Name: Network-tpr.238
Author: tpr
Time: 2 December 2019, 9:45:46.30357 pm
UUID: abb2a42a-56c3-467b-b070-8e49f1a18016
Ancestors: Network-nice.237
minor refactor and extension of email sending code.
Add support for user name & password when sending emails with a quick utility method - hence SMTPClient class>>#deliverMailFrom:to:text:usingServer:userName:password:
This required a minor refactor to make sure the login was actually done when opening the connection.
=============== Diff against Network-nice.237 ===============
Item was changed:
----- Method: ProtocolClient class>>openOnHostNamed: (in category 'instance creation') -----
+ openOnHostNamed: hostNameAndPort
+ "If the hostname uses the colon syntax to express a certain port number we use that instead of the default port number."
- openOnHostNamed: hostName
- "If the hostname uses the colon syntax to express a certain portnumber
- we use that instead of the default port number."
+ ^self new openOnHostNamed: hostNameAndPort
- | i |
- i := hostName indexOf: $:.
- i = 0 ifTrue: [
- ^self openOnHostNamed: hostName port: self defaultPortNumber]
- ifFalse: [
- | s p |
- s := hostName truncateTo: i - 1.
- p := (hostName copyFrom: i + 1 to: hostName size) asInteger.
- ^self openOnHostNamed: s port: p]
!
Item was changed:
----- Method: ProtocolClient class>>openOnHostNamed:port: (in category 'instance creation') -----
openOnHostNamed: hostName port: portNumber
- | serverIP |
- serverIP := NetNameResolver addressForName: hostName timeout: 20.
- serverIP ifNil:[ ^ nil].
+ ^ self new openOnHostNamed: hostName port: portNumber!
- ^ (self openOnHost: serverIP port: portNumber)
- hostName: hostName;
- yourself
- !
Item was changed:
----- Method: ProtocolClient>>openOnHost:port: (in category 'private') -----
openOnHost: hostIP port: portNumber
+ "open a connection to a specific port on a host for which we have the IP number.
+ We handle any login if the user and password are set"
self host: hostIP.
self port: portNumber.
self ensureConnection!
Item was added:
+ ----- Method: ProtocolClient>>openOnHostNamed: (in category 'private') -----
+ openOnHostNamed: hostNameAndPort
+ "If the hostname uses the colon syntax to express a certain port number
+ we use that instead of the default port number."
+
+ | thing hostName port |
+ "derive a host name and port number"
+ thing := hostNameAndPort splitBy: ':'.
+ hostName := thing first.
+ port := (thing at: 2 ifAbsent: [self defaultPortNumber]) asInteger.
+
+ ^self openOnHostNamed: hostName port: port
+ !
Item was added:
+ ----- Method: ProtocolClient>>openOnHostNamed:port: (in category 'private') -----
+ openOnHostNamed: hostName port: portNumber
+ "open a connection to a specific port on a server"
+ | serverIP |
+ serverIP := NetNameResolver addressForName: hostName timeout: 20.
+ self
+ hostName: hostName;
+ openOnHost: serverIP port: portNumber!
Item was changed:
----- Method: SMTPClient class>>deliverMailFrom:to:text:usingServer: (in category 'sending mail') -----
deliverMailFrom: fromAddress to: recipientList text: messageText usingServer: serverName
+ "Deliver a single email to a list of users and then close the connection - for delivering multiple messages, it is best to create a single connection and send all mail over it.
+ The serverName can include the port number - simply append ':587' for example to over ride the default port number.
+ No user name or password is used in this method; see deliverMailFrom:to:text:usingServer:userName:password: for more.
+ NOTE: the recipient list should be a collection of simple internet style addresses -- no '<>' or '()' stuff"
- "Deliver a single email to a list of users and then close the connection. For delivering multiple messages, it is best to create a single connection and send all mail over it. NOTE: the recipient list should be a collection of simple internet style addresses -- no '<>' or '()' stuff"
+ self deliverMailFrom: fromAddress to: recipientList text: messageText usingServer: serverName userName: nil password: nil
- | smtpClient |
- smtpClient := self openOnHostNamed: serverName.
- [smtpClient mailFrom: fromAddress to: recipientList text: messageText.
- smtpClient quit]
- ensure: [smtpClient close]
!
Item was added:
+ ----- Method: SMTPClient class>>deliverMailFrom:to:text:usingServer:userName:password: (in category 'sending mail') -----
+ deliverMailFrom: fromAddress to: recipientList text: messageText usingServer: serverName userName: uNameString password: pwdString
+ "Deliver a single email to a list of users and then close the connection - for delivering multiple messages, it is best to create a single connection and send all mail over it.
+ The serverName can include the port number - simply append ':587' for example to over ride the default port number.
+ If uNameString or pwdString are non-nil, set the uid/pwd for the client. It is inadvisable to try setting a uid and not a pwd, or indeed vice versa.
+ NOTE: the recipient list should be a collection of simple internet style addresses -- no '<>' or '()' stuff"
+
+ | smtpClient |
+ smtpClient := self new.
+
+ uNameString ifNotNil:[smtpClient user: uNameString].
+ pwdString ifNotNil:[smtpClient password: pwdString].
+ smtpClient openOnHostNamed: serverName.
+ [smtpClient mailFrom: fromAddress to: recipientList text: messageText.
+ smtpClient quit]
+ ensure: [smtpClient close]
+ !
Item was removed:
- ----- Method: SMTPClient class>>openOnHost:port: (in category 'instance creation') -----
- openOnHost: hostIP port: portNumber
-
- | client |
- client := super openOnHost: hostIP port: portNumber.
- client initiateSession.
- ^client!
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.865.mcz
==================== Summary ====================
Name: Collections-cmm.865
Author: cmm
Time: 30 November 2019, 9:33:26.626104 pm
UUID: 8a7c3294-372d-431b-b1f2-1daff3cb3a9e
Ancestors: Collections-mt.864
Let the printString of an OrderedDictionary reveal its key sequence.
=============== Diff against Collections-mt.864 ===============
Item was added:
+ ----- Method: Dictionary>>keysInOrder (in category 'accessing') -----
+ keysInOrder
+ "Answer the keys of the receiver in a particular sequence. This default is alphabetical, but subclasses like OrderedDictionary maintain their own sequence."
+ ^ self keysSortedSafely!
Item was changed:
----- Method: Dictionary>>printElementsOn: (in category 'printing') -----
printElementsOn: aStream
aStream nextPut: $(.
self size > 100
ifTrue: [aStream nextPutAll: 'size '.
self size printOn: aStream]
+ ifFalse: [self keysInOrder
- ifFalse: [self keysSortedSafely
do: [:key | aStream print: key;
nextPutAll: '->';
print: (self at: key);
space]].
aStream nextPut: $)!
Item was added:
+ ----- Method: OrderedDictionary>>keysInOrder (in category 'accessing') -----
+ keysInOrder
+ "Overridden. Preserve the order of the receiver."
+ ^ self keys!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1597.mcz
==================== Summary ====================
Name: Morphic-eem.1597
Author: eem
Time: 30 November 2019, 7:05:24.872005 pm
UUID: 068e0786-10ca-433e-9ec1-7c5cc2a15942
Ancestors: Morphic-eem.1596
Fix regression from hurried programming. Apologies!
=============== Diff against Morphic-eem.1596 ===============
Item was added:
+ ----- Method: TextEditor>>selectedLiteral (in category 'menu messages') -----
+ selectedLiteral
+ "Try to make a literal out of the current text selection"
+ | tokens |
+ tokens := Scanner new typedScanTokens: self selection string.
+ ^tokens isEmpty ifFalse: [tokens first]!
Item was changed:
----- Method: TextEditor>>selectedSelector (in category 'menu messages') -----
selectedSelector
"Try to make a selector out of the current text selection"
+ ^self selection string findSelector!
- | tokens |
- tokens := Scanner new typedScanTokens: self selection string.
- ^tokens isEmpty ifFalse: [tokens first]!