diff options
| author | Juanma Barranquero | 2008-01-10 01:55:24 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-01-10 01:55:24 +0000 |
| commit | f262b5b80f61f2232fe08eb8b0f8a24ad08f7943 (patch) | |
| tree | 9bbfef1832316ad80a6818b5920901389eb4e0f1 | |
| parent | eaf7efe9bae6b11fbd77d10c9ada51541548892d (diff) | |
| download | emacs-f262b5b80f61f2232fe08eb8b0f8a24ad08f7943.tar.gz emacs-f262b5b80f61f2232fe08eb8b0f8a24ad08f7943.zip | |
(select-safe-coding-system): When a buffer is modified, cancel the writing.
| -rw-r--r-- | lisp/international/mule-cmds.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 06473497c2e..ad9f73bcb43 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." | |||
| 966 | 966 | ||
| 967 | (let ((codings (find-coding-systems-region from to)) | 967 | (let ((codings (find-coding-systems-region from to)) |
| 968 | (coding-system nil) | 968 | (coding-system nil) |
| 969 | (tick (if (not (stringp from)) (buffer-modified-tick))) | ||
| 969 | safe rejected unsafe) | 970 | safe rejected unsafe) |
| 970 | (if (eq (car codings) 'undecided) | 971 | (if (eq (car codings) 'undecided) |
| 971 | ;; Any coding system is ok. | 972 | ;; Any coding system is ok. |
| @@ -1030,6 +1031,8 @@ It is highly recommended to fix it before writing to a file." | |||
| 1030 | %s specified by file contents. Really save (else edit coding cookies \ | 1031 | %s specified by file contents. Really save (else edit coding cookies \ |
| 1031 | and try again)? " coding-system auto-cs)) | 1032 | and try again)? " coding-system auto-cs)) |
| 1032 | (error "Save aborted")))) | 1033 | (error "Save aborted")))) |
| 1034 | (when (and tick (/= tick (buffer-modified-tick))) | ||
| 1035 | (error "Cancelled because the buffer was modified")) | ||
| 1033 | coding-system))) | 1036 | coding-system))) |
| 1034 | 1037 | ||
| 1035 | (setq select-safe-coding-system-function 'select-safe-coding-system) | 1038 | (setq select-safe-coding-system-function 'select-safe-coding-system) |