changeset 87430:f322e8d4c5e3

(select-safe-coding-system): When a buffer is modfied, cancel the writing.
author Kenichi Handa <handa@m17n.org>
date Thu, 27 Dec 2007 10:27:21 +0000
parents 09cae7fe2129
children 59242fb42f3a
files lisp/international/mule-cmds.el
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Thu Dec 27 05:50:36 2007 +0000
+++ b/lisp/international/mule-cmds.el	Thu Dec 27 10:27:21 2007 +0000
@@ -966,6 +966,7 @@
 
     (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 @@
 %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)