diff options
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lisp/files.el b/lisp/files.el index 5cff5b11ee9..a9a279b2fa4 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4759,7 +4759,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)) @@ -4775,14 +4775,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)) @@ -4864,11 +4856,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)) |