# HG changeset patch # User Juanma Barranquero # Date 1199930124 0 # Node ID 2fd2b52c4f9f0357ba779046ee30bcd079b6f497 # Parent 1fc1252447c5bd0f62c739b42e6139cc93731dd3 (select-safe-coding-system): When a buffer is modified, cancel the writing. diff -r 1fc1252447c5 -r 2fd2b52c4f9f lisp/international/mule-cmds.el --- a/lisp/international/mule-cmds.el Wed Jan 09 17:04:59 2008 +0000 +++ b/lisp/international/mule-cmds.el Thu Jan 10 01:55:24 2008 +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)