mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 00:00:39 -08:00
Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.org
This commit is contained in:
commit
c7367d2de3
20 changed files with 323 additions and 107 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue