# HG changeset patch # User Kenichi Handa # Date 1198751241 0 # Node ID f322e8d4c5e300967a85cbd6e6d25b0a1d2b3543 # Parent 09cae7fe212902d7e39eedf7b7d964a583889adb (select-safe-coding-system): When a buffer is modfied, cancel the writing. diff -r 09cae7fe2129 -r f322e8d4c5e3 lisp/international/mule-cmds.el --- 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)