diff options
| author | Kenichi Handa | 2007-12-27 10:28:28 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2007-12-27 10:28:28 +0000 |
| commit | 86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c (patch) | |
| tree | 69f4bacfcba84fc1aa6961b23bd4b67c73379048 | |
| parent | 8cc196146b96a0e28268b88cda746fcf4561551c (diff) | |
| download | emacs-86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c.tar.gz emacs-86c3a9fbd94ebdd7c4c8ddc2e671290327eefe2c.zip | |
(select-safe-coding-system): When a
buffer is modfied, cancel the writing.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4904dff206b..0de84114ed5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-12-27 Kenichi Handa <handa@ni.aist.go.jp> | ||
| 2 | |||
| 3 | * international/mule-cmds.el (select-safe-coding-system): When a | ||
| 4 | buffer is modfied, cancel the writing. | ||
| 5 | |||
| 1 | 2007-12-26 Eric S. Raymond <esr@snark.thyrsus.com> | 6 | 2007-12-26 Eric S. Raymond <esr@snark.thyrsus.com> |
| 2 | 7 | ||
| 3 | * log-view.el: Add Subversion and Mercurial log format samples. | 8 | * log-view.el: Add Subversion and Mercurial log format samples. |
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." | |||
| 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) |