diff options
| author | Kenichi Handa | 2005-07-29 06:17:39 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-07-29 06:17:39 +0000 |
| commit | 356384dc0f416f9e81b2e2c657632d81becaeec1 (patch) | |
| tree | cd0837eae4073b322cdcec78e736ceb79729165e | |
| parent | 6c7c9d2369449676fab8ea2916433f8f48f915c1 (diff) | |
| download | emacs-356384dc0f416f9e81b2e2c657632d81becaeec1.tar.gz emacs-356384dc0f416f9e81b2e2c657632d81becaeec1.zip | |
(coding-system-get): Check
`ascii-incompatible' for backward compatiblity.
(set-file-name-coding-system): Signal an error for a coding system
not suitable for file name.
(set-keyboard-coding-system): Signal an error for a coding system
not suitable for keyboard.
| -rw-r--r-- | lisp/international/mule.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index b66ef2cd028..52a98145534 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -842,8 +842,12 @@ For compatibility with Emacs 20/21, this accepts old-style symbols | |||
| 842 | like `mime-charset' as well as the current style like `:mime-charset'." | 842 | like `mime-charset' as well as the current style like `:mime-charset'." |
| 843 | (or (plist-get (coding-system-plist coding-system) prop) | 843 | (or (plist-get (coding-system-plist coding-system) prop) |
| 844 | (if (not (keywordp prop)) | 844 | (if (not (keywordp prop)) |
| 845 | (plist-get (coding-system-plist coding-system) | 845 | ;; For backward compatiblity. |
| 846 | (intern (concat ":" (symbol-name prop))))))) | 846 | (if (eq prop 'ascii-incompatible) |
| 847 | (not (plist-get (coding-system-plist coding-system) | ||
| 848 | :ascii-compatible-p)) | ||
| 849 | (plist-get (coding-system-plist coding-system) | ||
| 850 | (intern (concat ":" (symbol-name prop)))))))) | ||
| 847 | 851 | ||
| 848 | (defun coding-system-eol-type-mnemonic (coding-system) | 852 | (defun coding-system-eol-type-mnemonic (coding-system) |
| 849 | "Return the string indicating end-of-line format of CODING-SYSTEM." | 853 | "Return the string indicating end-of-line format of CODING-SYSTEM." |
| @@ -1173,6 +1177,10 @@ It actually just set the variable `file-name-coding-system' (which | |||
| 1173 | see) to CODING-SYSTEM." | 1177 | see) to CODING-SYSTEM." |
| 1174 | (interactive "zCoding system for file names (default, nil): ") | 1178 | (interactive "zCoding system for file names (default, nil): ") |
| 1175 | (check-coding-system coding-system) | 1179 | (check-coding-system coding-system) |
| 1180 | (if (and coding-system | ||
| 1181 | (not (coding-system-get coding-system :ascii-compatible-p)) | ||
| 1182 | (not (coding-system-get coding-system :suitable-for-file-name))) | ||
| 1183 | (error "%s is not suitable for file names" coding-system)) | ||
| 1176 | (setq file-name-coding-system coding-system)) | 1184 | (setq file-name-coding-system coding-system)) |
| 1177 | 1185 | ||
| 1178 | (defvar default-terminal-coding-system nil | 1186 | (defvar default-terminal-coding-system nil |
| @@ -1229,6 +1237,10 @@ or by the previous use of this command." | |||
| 1229 | (setq coding-system default-keyboard-coding-system)) | 1237 | (setq coding-system default-keyboard-coding-system)) |
| 1230 | (if coding-system | 1238 | (if coding-system |
| 1231 | (setq default-keyboard-coding-system coding-system)) | 1239 | (setq default-keyboard-coding-system coding-system)) |
| 1240 | (if (and coding-system | ||
| 1241 | (not (coding-system-get coding-system :ascii-compatible-p)) | ||
| 1242 | (not (coding-system-get coding-system :suitable-for-keyboard))) | ||
| 1243 | (error "%s is not suitable for keyboard" coding-system)) | ||
| 1232 | (set-keyboard-coding-system-internal coding-system) | 1244 | (set-keyboard-coding-system-internal coding-system) |
| 1233 | (setq keyboard-coding-system coding-system) | 1245 | (setq keyboard-coding-system coding-system) |
| 1234 | (encoded-kbd-mode (if coding-system 1 0))) | 1246 | (encoded-kbd-mode (if coding-system 1 0))) |