summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/files.el13
2 files changed, 9 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cec6e709c2b..ba8dac2c4e9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2014-08-11 Glenn Morris <rgm@gnu.org>
+
+ * files.el (basic-save-buffer-2): Revert 2013-01-31 change, which
+ chose coding system for writing before backing up, since it causes
+ a more serious problem than the one it solves. (Closes Bug#18141,
+ reopens Bug#13522.)
+
2014-08-10 Martin Rudalics <rudalics@gmx.at>
* window.el (window-total-size): Make doc-string more
diff --git a/lisp/files.el b/lisp/files.el
index 6c3b8f4fa4d..5ed5f8a6e1e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4756,7 +4756,7 @@ Before and after saving the buffer, this function runs
;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like
;; backup-buffer.
(defun basic-save-buffer-2 ()
- (let (tempsetmodes setmodes writecoding)
+ (let (tempsetmodes setmodes)
(if (not (file-writable-p buffer-file-name))
(let ((dir (file-name-directory buffer-file-name)))
(if (not (file-directory-p dir))
@@ -4772,14 +4772,6 @@ Before and after saving the buffer, this function runs
buffer-file-name)))
(setq tempsetmodes t)
(error "Attempt to save to a file which you aren't allowed to write"))))))
- ;; This may involve prompting, so do it now before backing up the file.
- ;; Otherwise there can be a delay while the user answers the
- ;; prompt during which the original file has been renamed. (Bug#13522)
- (setq writecoding
- ;; Args here should match write-region call below around
- ;; which we use writecoding.
- (choose-write-coding-system nil nil buffer-file-name nil t
- buffer-file-truename))
(or buffer-backed-up
(setq setmodes (backup-buffer)))
(let* ((dir (file-name-directory buffer-file-name))
@@ -4861,11 +4853,10 @@ Before and after saving the buffer, this function runs
(logior (car setmodes) 128))))))
(let (success)
(unwind-protect
+ (progn
;; Pass in nil&nil rather than point-min&max to indicate
;; we're saving the buffer rather than just a region.
;; write-region-annotate-functions may make us of it.
- (let ((coding-system-for-write writecoding)
- (coding-system-require-warning nil))
(write-region nil nil
buffer-file-name nil t buffer-file-truename)
(setq success t))