newbie: nice text file

Jörn Eyrich Joern.Eyrich at brokat.com
Wed May 2 17:14:28 UTC 2001


Hi Jeff,

you could run the file you get through a translator afterwards in the shell:
$ cat Workspace.text | tr '\r' '\n' >myfilename

You can also change the name of the Workspace window by selecting "Change title..." from the menu that pops up when you select the little icon right of the "X" window close icon in the left part of the titlebar. The default filename is <WindowTitle>.text


But hey, this is Smalltalk:
If you do a user interrupt (Alt-. [Alt-<dot>] on Windows, maybe Ctrl-. on Linux) while you are prompted for the file name, and press "Debug" in the resulting window, you can actually look at the code that does this - and change it to do what you want.

In the upper pane of the debugger, you see a stack trace. scrolling down, we note classes called "FillInTheBlank*" - we assume these are responsible for the file name dialog.

Under that, we see "TextMorphEditor(ParagraphEditor)>>saveContentsInFile", this sounds like the operation we requested.
Click on it and the middle pane shows the corresponding method source.

Here you can comment out the code that appends ".text", for example, or cut out the whole prompt
If you replace the "FileStream" with a "CrLfFileStream", this should take care of giving you the right CR/LF scheme for your platform.

You can then select "accept" from the menu (or do Alt-s), and select "restart", and your changed code will run.

Have fun Squeaking,
Joern





More information about the Squeak-dev mailing list