1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-21 18:23:59 +00:00

(select-safe-coding-system): When a

buffer is modfied, cancel the writing.
This commit is contained in:
Kenichi Handa 2007-12-27 10:28:28 +00:00
parent 8cc196146b
commit 86c3a9fbd9
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-12-27 Kenichi Handa <handa@ni.aist.go.jp>
* international/mule-cmds.el (select-safe-coding-system): When a
buffer is modfied, cancel the writing.
2007-12-26 Eric S. Raymond <esr@snark.thyrsus.com>
* log-view.el: Add Subversion and Mercurial log format samples.

View File

@ -966,6 +966,7 @@ It is highly recommended to fix it before writing to a file."
(let ((codings (find-coding-systems-region from to))
(coding-system nil)
(tick (if (not (stringp from)) (buffer-modified-tick)))
safe rejected unsafe)
(if (eq (car codings) 'undecided)
;; Any coding system is ok.
@ -1030,6 +1031,8 @@ It is highly recommended to fix it before writing to a file."
%s specified by file contents. Really save (else edit coding cookies \
and try again)? " coding-system auto-cs))
(error "Save aborted"))))
(when (and tick (/= tick (buffer-modified-tick)))
(error "Cancelled because the buffer was modified"))
coding-system)))
(setq select-safe-coding-system-function 'select-safe-coding-system)