[squeak-dev] How to file out all the methods in a message list window?

Scott Wallace squeaklist at pacbell.net
Mon Jun 23 05:45:43 UTC 2008

On Jun 21, 2008, at 3:53 AM, askoh wrote:

> When I right click 'sender of' I get a message list window of methods. How do
> I file out all the methods in that message list window into one *.st file?

The basic unit for creating fileouts is the change-set.  So a way to approach this is to create a new change-set and get all the messages in your message-list to be in that change-set; then file-out the change-set.  This will give you precisely what you want.

But how to get all the methods that re in your message-list into the change-set?  Here are four possibilities:

(1)  Select, in turn, each method in your message-list window; after each one is selected, type a space followed by a backspace (thus marking the method as "changed" without really changing it), then accept ("save") the method afresh.  After you've done that to all methods in your method-list, the fresh change-set you created will bear precisely that method-list as its list of changes, so you can file out the change-set (using a change-sorter) and you'll have what you want.

(2)  Bring up, and "pin up', the shifted selector-list menu for the message-list in question.  Find the item "add to current change set" there.  Now, in turn, select each item in the message list, then hit that "add to current change-set" item.  This places the method in the current change-set without actually modifying it.

(3)  If you have a big message list, both of the above may be too labor-intensive.  So instead, you can open an Inspector on the model of the message list. In the bottom pane of that Inspector, type and then evaluate the following expression:

    self messageList do:
        [:mr | ChangeSet current adoptSelector: mr methodSymbol forClass: mr actualClass]

(4)  Finally, if you have a frequent need for such a feature, it would be a very simple matter to add a menu item to the selector-list menu to carry out the work described in alternative (3).


-- Scott

More information about the Squeak-dev mailing list