summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2007-12-27 10:28:28 +0000
committerKenichi Handa <handa@m17n.org>2007-12-27 10:28:28 +0000
commit86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c (patch)
tree69f4bacfcba84fc1aa6961b23bd4b67c73379048 /lisp/international/mule-cmds.el
parent8cc196146b96a0e28268b88cda746fcf4561551c (diff)
downloademacs-86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c.tar.gz
(select-safe-coding-system): When a
buffer is modfied, cancel the writing.
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 77ef1f9cd40..f8dc141943f 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -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)