Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.521.mcz ==================== Summary ==================== Name: Tools-nice.521 Author: nice Time: 13 May 2014, 10:29:52.892 pm UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b Ancestors: Tools-nice.520 Fix issue http://bugs.squeak.org/view.php?id=5504 Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! =============== Diff against Tools-nice.520 =============== Item was changed: ----- Method: FileList>>put: (in category 'private') ----- put: aText "Private - put the supplied text onto the file" + | ff type newName | - | ff type | brevityState == #fullFile ifTrue: [ff := directory newFileNamed: self fullName. Cursor write showWhile: [ff nextPutAll: aText asString; close]. + (directory = ff directory and: [fileName = ff localName]) - fileName = ff localName ifTrue: [contents := aText asString] + ifFalse: "user changed the directory and/or renamed the file" + [self clearUserEditFlag. + directory ~= ff directory ifTrue: + [self directory: ff directory. + self changed: #rootDirectoryList; changed: #selectedPath]. + self updateFileList. + contents := aText asString. + newName := ff localName. + listIndex := list findFirst: [:item | (self fileNameFromFormattedItem: item) = newName]. + listIndex > 0 ifTrue: [fileName := newName]. + brevityState := #needToGetBrief. + self changed: #fileListIndex]. + self changed: #relabel. - ifFalse: [self updateFileList]. "user renamed the file" ^ true "accepted"]. listIndex = 0 ifTrue: [self inform: 'No fileName is selected' translated. ^ false "failed"]. type := 'These'. brevityState = #briefFile ifTrue: [type := 'Abbreviated']. brevityState = #briefHex ifTrue: [type := 'Abbreviated']. brevityState = #fullHex ifTrue: [type := 'Hexadecimal']. brevityState = #FileList ifTrue: [type := 'Directory']. self inform: ('{1} contents cannot meaningfully be saved at present.' translated format:{type translated}). ^ false "failed" ! |
On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] wrote:
> Nicolas Cellier uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-nice.521.mcz > > ==================== Summary ==================== > > Name: Tools-nice.521 > Author: nice > Time: 13 May 2014, 10:29:52.892 pm > UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b > Ancestors: Tools-nice.520 > > Fix issue http://bugs.squeak.org/view.php?id=5504 > Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... > Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! > Bravo Nicolas! Driving an issue to resolution after so many years is a very good thing. Dave |
A much bigger problem than that, though, is how easy it is to lose
changes because the file on disk has changed while the image was closed (e.g., edited within another image). When the original image reopens, the text file being edited is not refreshed, it's still the old version, so saving a new change blows away the other changes that were made in the other image while this image was closed. On Tue, May 13, 2014 at 8:06 PM, David T. Lewis <[hidden email]> wrote: > On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] wrote: >> Nicolas Cellier uploaded a new version of Tools to project The Trunk: >> http://source.squeak.org/trunk/Tools-nice.521.mcz >> >> ==================== Summary ==================== >> >> Name: Tools-nice.521 >> Author: nice >> Time: 13 May 2014, 10:29:52.892 pm >> UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b >> Ancestors: Tools-nice.520 >> >> Fix issue http://bugs.squeak.org/view.php?id=5504 >> Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... >> Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! >> > > Bravo Nicolas! Driving an issue to resolution after so many years is a very good thing. > > Dave > > |
Chris,
On May 14, 2014, at 8:47 AM, Chris Muller <[hidden email]> wrote: > A much bigger problem than that, though, is how easy it is to lose > changes because the file on disk has changed while the image was > closed (e.g., edited within another image). When the original image > reopens, the text file being edited is not refreshed, it's still the > old version, so saving a new change blows away the other changes that > were made in the other image while this image was closed. Patient: it hurts when I hit myself in the head. Doctor: don't do that. > On Tue, May 13, 2014 at 8:06 PM, David T. Lewis <[hidden email]> wrote: >> On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] wrote: >>> Nicolas Cellier uploaded a new version of Tools to project The Trunk: >>> http://source.squeak.org/trunk/Tools-nice.521.mcz >>> >>> ==================== Summary ==================== >>> >>> Name: Tools-nice.521 >>> Author: nice >>> Time: 13 May 2014, 10:29:52.892 pm >>> UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b >>> Ancestors: Tools-nice.520 >>> >>> Fix issue http://bugs.squeak.org/view.php?id=5504 >>> Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... >>> Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! >> >> Bravo Nicolas! Driving an issue to resolution after so many years is a very good thing. >> >> Dave > |
That analogy is a mischaracterisation of the problem. Hitting oneself
in the head requires a knowing, concious act. Accidently saving ones "notes.txt" in another image can easily occur unknowingly.. On Wed, May 14, 2014 at 11:03 AM, Eliot Miranda <[hidden email]> wrote: > Chris, > > On May 14, 2014, at 8:47 AM, Chris Muller <[hidden email]> wrote: > >> A much bigger problem than that, though, is how easy it is to lose >> changes because the file on disk has changed while the image was >> closed (e.g., edited within another image). When the original image >> reopens, the text file being edited is not refreshed, it's still the >> old version, so saving a new change blows away the other changes that >> were made in the other image while this image was closed. > > Patient: it hurts when I hit myself in the head. > > Doctor: don't do that. > >> On Tue, May 13, 2014 at 8:06 PM, David T. Lewis <[hidden email]> wrote: >>> On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] wrote: >>>> Nicolas Cellier uploaded a new version of Tools to project The Trunk: >>>> http://source.squeak.org/trunk/Tools-nice.521.mcz >>>> >>>> ==================== Summary ==================== >>>> >>>> Name: Tools-nice.521 >>>> Author: nice >>>> Time: 13 May 2014, 10:29:52.892 pm >>>> UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b >>>> Ancestors: Tools-nice.520 >>>> >>>> Fix issue http://bugs.squeak.org/view.php?id=5504 >>>> Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... >>>> Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! >>> >>> Bravo Nicolas! Driving an issue to resolution after so many years is a very good thing. >>> >>> Dave >> > |
In reply to this post by Eliot Miranda-2
Check out the text editor bundled with Ubuntu, "gedit", which has this
feature. Browse a log text file that Squeak is writing to. It presents a message when it's dirty and gives you the option of reloading the file. As bad as gedit is in other ways, they excel on this one. On Wed, May 14, 2014 at 11:03 AM, Eliot Miranda <[hidden email]> wrote: > Chris, > > On May 14, 2014, at 8:47 AM, Chris Muller <[hidden email]> wrote: > >> A much bigger problem than that, though, is how easy it is to lose >> changes because the file on disk has changed while the image was >> closed (e.g., edited within another image). When the original image >> reopens, the text file being edited is not refreshed, it's still the >> old version, so saving a new change blows away the other changes that >> were made in the other image while this image was closed. > > Patient: it hurts when I hit myself in the head. > > Doctor: don't do that. > >> On Tue, May 13, 2014 at 8:06 PM, David T. Lewis <[hidden email]> wrote: >>> On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] wrote: >>>> Nicolas Cellier uploaded a new version of Tools to project The Trunk: >>>> http://source.squeak.org/trunk/Tools-nice.521.mcz >>>> >>>> ==================== Summary ==================== >>>> >>>> Name: Tools-nice.521 >>>> Author: nice >>>> Time: 13 May 2014, 10:29:52.892 pm >>>> UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b >>>> Ancestors: Tools-nice.520 >>>> >>>> Fix issue http://bugs.squeak.org/view.php?id=5504 >>>> Saving as a different file name in FileList does incorrectly update text contents to directory contents rather than file contents... >>>> Thanks sumim, 8 years for this report to be taken into account, and 4 years for the fix to get accepted, a chance that it did not rot! >>> >>> Bravo Nicolas! Driving an issue to resolution after so many years is a very good thing. >>> >>> Dave >> > |
On Wed, May 14, 2014 at 10:55 AM, Chris Muller <[hidden email]> wrote: Check out the text editor bundled with Ubuntu, "gedit", which has this That's fine. It sounds good. But why on earth would one write to a changes file unless one was doing conscious surgery? If someone said "I just made random edits to my C source file and now it no longer compiles.", what would your reaction be?
best, Eliot
|
I wasn't talking about the changes file. I was talking about Daves
grocery list. If you ever "Save as..." your image to a temp image to "try something risky," but later forget you're in your temp image and make some edits to your grocery list and save the text file while in that image, when you flip back to the original image, be careful about the open grocery-list window, it's stale with no indication that it is so. Does that make sense? Seems like it would be pretty easy to implement a fix -- just let the Workspace model know the timestamp of the file it loaded, and compare to that timestamp in the filesystem at opportune times (such as when the window gains focus..). On Wed, May 14, 2014 at 2:17 PM, Eliot Miranda <[hidden email]> wrote: > > > > On Wed, May 14, 2014 at 10:55 AM, Chris Muller <[hidden email]> wrote: >> >> Check out the text editor bundled with Ubuntu, "gedit", which has this >> feature. Browse a log text file that Squeak is writing to. It >> presents a message when it's dirty and gives you the option of >> reloading the file. As bad as gedit is in other ways, they excel on >> this one. > > > That's fine. It sounds good. But why on earth would one write to a changes > file unless one was doing conscious surgery? If someone said "I just made > random edits to my C source file and now it no longer compiles.", what would > your reaction be? > >> >> On Wed, May 14, 2014 at 11:03 AM, Eliot Miranda <[hidden email]> >> wrote: >> > Chris, >> > >> > On May 14, 2014, at 8:47 AM, Chris Muller <[hidden email]> wrote: >> > >> >> A much bigger problem than that, though, is how easy it is to lose >> >> changes because the file on disk has changed while the image was >> >> closed (e.g., edited within another image). When the original image >> >> reopens, the text file being edited is not refreshed, it's still the >> >> old version, so saving a new change blows away the other changes that >> >> were made in the other image while this image was closed. >> > >> > Patient: it hurts when I hit myself in the head. >> > >> > Doctor: don't do that. >> > >> >> On Tue, May 13, 2014 at 8:06 PM, David T. Lewis <[hidden email]> >> >> wrote: >> >>> On Tue, May 13, 2014 at 08:30:24PM +0000, [hidden email] >> >>> wrote: >> >>>> Nicolas Cellier uploaded a new version of Tools to project The Trunk: >> >>>> http://source.squeak.org/trunk/Tools-nice.521.mcz >> >>>> >> >>>> ==================== Summary ==================== >> >>>> >> >>>> Name: Tools-nice.521 >> >>>> Author: nice >> >>>> Time: 13 May 2014, 10:29:52.892 pm >> >>>> UUID: 33d41589-c752-4fa3-9387-2b8b0a8c942b >> >>>> Ancestors: Tools-nice.520 >> >>>> >> >>>> Fix issue http://bugs.squeak.org/view.php?id=5504 >> >>>> Saving as a different file name in FileList does incorrectly update >> >>>> text contents to directory contents rather than file contents... >> >>>> Thanks sumim, 8 years for this report to be taken into account, and 4 >> >>>> years for the fix to get accepted, a chance that it did not rot! >> >>> >> >>> Bravo Nicolas! Driving an issue to resolution after so many years is a >> >>> very good thing. >> >>> >> >>> Dave >> >> >> > >> > > > > -- > best, > Eliot > > > |
On Wed, May 14, 2014 at 12:39 PM, Chris Muller <[hidden email]> wrote: I wasn't talking about the changes file. I was talking about Daves Yes.
Why not have it hold onto an inode and nuke the record of the inode on save? The inode of the image and changes files will ne different in the save as... new name image.
best, Eliot
|
Free forum by Nabble | Edit this page |