Mercurial > emacs
comparison lisp/international/ucs-tables.el @ 54642:abb31042a0e6
(ucs-insert): Fix the error message.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 29 Mar 2004 12:01:21 +0000 |
parents | a8d654e3dbcb |
children | 244826afc178 |
comparison
equal
deleted
inserted
replaced
54641:77a99ef5c0ae | 54642:abb31042a0e6 |
---|---|
1245 | 1245 |
1246 (defun ucs-insert (arg) | 1246 (defun ucs-insert (arg) |
1247 "Insert the Emacs character representation of the given Unicode. | 1247 "Insert the Emacs character representation of the given Unicode. |
1248 Interactively, prompts for a hex string giving the code." | 1248 Interactively, prompts for a hex string giving the code." |
1249 (interactive "sUnicode (hex): ") | 1249 (interactive "sUnicode (hex): ") |
1250 (let ((c (decode-char 'ucs (if (integerp arg) | 1250 (or (integerp arg) |
1251 arg | 1251 (setq arg (string-to-number arg 16))) |
1252 (string-to-number arg 16))))) | 1252 (let ((c (decode-char 'ucs arg ))) |
1253 (if c | 1253 (if c |
1254 (insert c) | 1254 (insert c) |
1255 (error "Character can't be decoded to UCS")))) | 1255 (if (or (< arg 0) (> arg #x10FFFF)) |
1256 (error "Not a Unicode character code: 0x%X" arg) | |
1257 (error "Character U+%04X is not yet supported" arg))))) | |
1256 | 1258 |
1257 ;;; Dealing with non-8859 character sets. | 1259 ;;; Dealing with non-8859 character sets. |
1258 | 1260 |
1259 ;; We only set up translation on encoding to utf-8. Also translation | 1261 ;; We only set up translation on encoding to utf-8. Also translation |
1260 ;; tables ucs-CS-encode-table are constructed for some coding systems | 1262 ;; tables ucs-CS-encode-table are constructed for some coding systems |