diff options
| author | Richard M. Stallman | 1998-05-11 01:22:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-11 01:22:35 +0000 |
| commit | c83c4f60988647a387eddd85c8698112cc3c4e04 (patch) | |
| tree | 8b38fe7e7191a51a3bdb04e4f4a5d2e4d301da84 | |
| parent | 0412d833601f074eb6b39cfdb298e098eff69f3c (diff) | |
| download | emacs-c83c4f60988647a387eddd85c8698112cc3c4e04.tar.gz emacs-c83c4f60988647a387eddd85c8698112cc3c4e04.zip | |
(last-coding-system-specified): New var.
(select-safe-coding-system): Set var if user specifies a coding system.
| -rw-r--r-- | lisp/international/mule-cmds.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 305bf256a61..cf80099e437 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -303,6 +303,13 @@ CHARSETS is a list of character sets." | |||
| 303 | (sort codings (function (lambda (x y) (> (car x) (car y)))))) | 303 | (sort codings (function (lambda (x y) (> (car x) (car y)))))) |
| 304 | ))) | 304 | ))) |
| 305 | 305 | ||
| 306 | (defvar last-coding-system-specified nil | ||
| 307 | "Most recent coding system explicitly specified by the user when asked. | ||
| 308 | This variable is set whenever Emacs asks the user which coding system | ||
| 309 | to use in order to write a file. If you set it to nil explicitly, | ||
| 310 | then call `write-region', then afterward this variable will be non-nil | ||
| 311 | only if the user was explicitly asked and specified a coding system.") | ||
| 312 | |||
| 306 | (defun select-safe-coding-system (from to &optional default-coding-system) | 313 | (defun select-safe-coding-system (from to &optional default-coding-system) |
| 307 | "Ask a user to select a safe coding system from candidates. | 314 | "Ask a user to select a safe coding system from candidates. |
| 308 | The candidates of coding systems which can safely encode a text | 315 | The candidates of coding systems which can safely encode a text |
| @@ -364,7 +371,7 @@ Please select one from the following safe coding systems:\n" | |||
| 364 | (format "Select coding system (default %s): " | 371 | (format "Select coding system (default %s): " |
| 365 | (car safe-coding-systems)) | 372 | (car safe-coding-systems)) |
| 366 | safe-names nil t nil nil (car (car safe-names))))) | 373 | safe-names nil t nil nil (car (car safe-names))))) |
| 367 | (intern name)) | 374 | (setq last-coding-system-specified (intern name))) |
| 368 | (kill-buffer "*Warning*")))))) | 375 | (kill-buffer "*Warning*")))))) |
| 369 | 376 | ||
| 370 | (setq select-safe-coding-system-function 'select-safe-coding-system) | 377 | (setq select-safe-coding-system-function 'select-safe-coding-system) |