[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

saving a buffer when the file has been modified on disk

From: Sam Steingold
Subject: saving a buffer when the file has been modified on disk
Date: Thu, 01 Oct 2009 14:19:59 -0400
User-agent: Thunderbird (X11/20090625)

When I try to save a file which has been modified on disk by another program, basic-save-buffer asks "<file> has changed since visited or saved. Save anyway?". The most useful behavior would be to offer to merge the file on disk with my current buffer, but I am not offered such an option. Moreover, both emerge and ediff (why are there two such packages?! shouldn't emerge be removed?) offer only file+file and buffer+buffer merges, not buffer+file merges (this is, of course, only a minor nuisance, one can easily create a temp buffer, insert the file there and merge buffers).

1. add ediff-merge-buffer-with-file which would merge the current buffer with the file on disk if the latter has been modified.
2. remove diff-buffer-with-file.

3a. basic-save-buffer should ask "<file> has changed since visited or saved. Merge the changes?" and, if the user agrees, call, ediff-merge-buffer-with-file before proceeding to save the buffer. The current "abort" behavior will still be available via C-g


3b. basic-save-buffer should recommend ediff-merge-buffer-with-file:

--- files.el    25 Sep 2009 22:04:10 -0000      1.1086
+++ files.el    1 Oct 2009 18:18:16 -0000
@@ -4194,7 +4206,7 @@ Before and after saving the buffer, this
               (format "%s has changed since visited or saved.  Save anyway? "
                       (file-name-nondirectory buffer-file-name)))
-             (error "Save not confirmed"))
+ (error "Save not confirmed; use ediff-merge-buffer-with-file to merge the changes"))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]