bugGNU Zile (Zile implements Lua Editors) - Bugs: bug #34046, Zile overwrites externally changed...

 
 

bug #34046: Zile overwrites externally changed file

Submitted by:  Gary V. Vaughan <gary>
Submitted on:  Thu 18 Aug 2011 11:05:00 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Status: NoneAssigned to: None
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 21 Feb 2012 07:19:23 PM UTC, comment #3:

Thanks very much for the patch.

This sort of thing is fine for Zi, but won't do for Zile, which must behave like Emacs. Emacs notifies the user when the buffer changes. So you have two options: detect file changes more regularly (as Emacs), or rewrite the patch for the Zi branch (in Lua).

Sorry to be awkward, but Zile strives never to behave differently from Emacs.

Reuben Thomas <rrt>
Project Administrator
Tue 21 Feb 2012 04:56:28 PM UTC, comment #2:

A quick solution to this can be seen in my attached patch.
At any time a buffer should be written to disk the modification time of the corresponding file is checked. If a difference occurs, a message is printed in the minibuffer.

I know, that this is probably not the cleanest way to implement this.

(file #25100)

Anonymous
Thu 18 Aug 2011 07:45:26 PM UTC, comment #1:

Agreed that this should be implemented. I don't propose to do it immediately.

Reuben Thomas <rrt>
Project Administrator
Thu 18 Aug 2011 11:05:00 AM UTC, original submission:

Technically this is a new feature, but since in involves data loss, I think it's important enough to consider to be a bug... same for C and Lua branches:

$ echo foo > y
$ zile y
^Z
$ echo bar > y
$ fg
xxx^X^S^X^C
$ cat y
xxxfoo

Where did the 'bar' go?

With emacs, at the point you press the first 'x' it says:

y changed on disk, really edit the buffer? (y, n, r, C-h) _

and if you accept by pressing y:

File on disk will now become a backup file if you save these changes

and then when you actually try to save:

y has changed since visited or saved. Save anyway? (yes or no)

Dunno if we need to go quite that far, but we definitely need to spot files that have been externally changed before saving over them.

Aside: For zi (at least), I much prefer TextMate's handling of external edits: it quietly updates the buffer with the new contents of the file if the buffer has not been edited yet, or else asks whether to revert to the disk contents, or keep the buffer intact.

Gary V. Vaughan <gary>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #25100:  change_notification.patch added by None (3kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rrt (Posted a comment)
  • -unavailable- added by gary (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Feb 2012 04:56:28 PM UTCNoneAttached File-=>Added change_notification.patch, #25100

    Back to the top


    Powered by Savane 3.1-cleanup