# HG changeset patch # User Kenichi Handa # Date 1122617859 0 # Node ID 76ab0b868ab076e8c484584062aaace38cd94ad1 # Parent efcbeb957a316965fc49c81a3f9fb88a81aa8239 (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. diff -r efcbeb957a31 -r 76ab0b868ab0 lisp/international/mule.el --- a/lisp/international/mule.el Fri Jul 29 06:15:24 2005 +0000 +++ b/lisp/international/mule.el Fri Jul 29 06:17:39 2005 +0000 @@ -842,8 +842,12 @@ like `mime-charset' as well as the current style like `:mime-charset'." (or (plist-get (coding-system-plist coding-system) prop) (if (not (keywordp prop)) - (plist-get (coding-system-plist coding-system) - (intern (concat ":" (symbol-name prop))))))) + ;; For backward compatiblity. + (if (eq prop 'ascii-incompatible) + (not (plist-get (coding-system-plist coding-system) + :ascii-compatible-p)) + (plist-get (coding-system-plist coding-system) + (intern (concat ":" (symbol-name prop)))))))) (defun coding-system-eol-type-mnemonic (coding-system) "Return the string indicating end-of-line format of CODING-SYSTEM." @@ -1173,6 +1177,10 @@ see) to CODING-SYSTEM." (interactive "zCoding system for file names (default, nil): ") (check-coding-system coding-system) + (if (and coding-system + (not (coding-system-get coding-system :ascii-compatible-p)) + (not (coding-system-get coding-system :suitable-for-file-name))) + (error "%s is not suitable for file names" coding-system)) (setq file-name-coding-system coding-system)) (defvar default-terminal-coding-system nil @@ -1229,6 +1237,10 @@ (setq coding-system default-keyboard-coding-system)) (if coding-system (setq default-keyboard-coding-system coding-system)) + (if (and coding-system + (not (coding-system-get coding-system :ascii-compatible-p)) + (not (coding-system-get coding-system :suitable-for-keyboard))) + (error "%s is not suitable for keyboard" coding-system)) (set-keyboard-coding-system-internal coding-system) (setq keyboard-coding-system coding-system) (encoded-kbd-mode (if coding-system 1 0)))