diff options
| author | Juri Linkov | 2009-08-12 20:43:08 +0000 |
|---|---|---|
| committer | Juri Linkov | 2009-08-12 20:43:08 +0000 |
| commit | dcbac02a437fc7fce38b269d2962dd61a83f0184 (patch) | |
| tree | 80a2f62655f643f8c34b4f8abb1287bff1840839 | |
| parent | 777488480f77d81287a8687a318414ea7209769f (diff) | |
| download | emacs-dcbac02a437fc7fce38b269d2962dd61a83f0184.tar.gz emacs-dcbac02a437fc7fce38b269d2962dd61a83f0184.zip | |
(ucs-insert): Change arguments from `arg' to `character', `count',
`inherit' to be the same as in `insert-char'. Doc fix. (Bug#4039)
| -rw-r--r-- | lisp/international/mule-cmds.el | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index dde00e1af6a..5ec3f286b9d 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2917,19 +2917,28 @@ for decimal. Returns a character as a number." | |||
| 2917 | (t | 2917 | (t |
| 2918 | (cdr (assoc-string input (ucs-names) t)))))) | 2918 | (cdr (assoc-string input (ucs-names) t)))))) |
| 2919 | 2919 | ||
| 2920 | (defun ucs-insert (arg) | 2920 | (defun ucs-insert (character &optional count inherit) |
| 2921 | "Insert a character of the given Unicode code point. | 2921 | "Insert COUNT copies of CHARACTER of the given Unicode code point. |
| 2922 | Interactively, prompts for a Unicode character name or a hex number | 2922 | Interactively, prompts for a Unicode character name or a hex number |
| 2923 | using `read-char-by-name'." | 2923 | using `read-char-by-name'. |
| 2924 | (interactive (list (read-char-by-name "Unicode (name or hex): "))) | 2924 | The optional third arg INHERIT (non-nil when called interactively), |
| 2925 | (if (stringp arg) | 2925 | says to inherit text properties from adjoining text, if those |
| 2926 | (setq arg (string-to-number arg 16))) | 2926 | properties are sticky." |
| 2927 | (interactive | ||
| 2928 | (list (read-char-by-name "Unicode (name or hex): ") | ||
| 2929 | (prefix-numeric-value current-prefix-arg) | ||
| 2930 | t)) | ||
| 2931 | (unless count (setq count 1)) | ||
| 2932 | (if (stringp character) | ||
| 2933 | (setq character (string-to-number character 16))) | ||
| 2927 | (cond | 2934 | (cond |
| 2928 | ((not (integerp arg)) | 2935 | ((not (integerp character)) |
| 2929 | (error "Not a Unicode character code: %S" arg)) | 2936 | (error "Not a Unicode character code: %S" character)) |
| 2930 | ((or (< arg 0) (> arg #x10FFFF)) | 2937 | ((or (< character 0) (> character #x10FFFF)) |
| 2931 | (error "Not a Unicode character code: 0x%X" arg))) | 2938 | (error "Not a Unicode character code: 0x%X" character))) |
| 2932 | (insert-and-inherit arg)) | 2939 | (if inherit |
| 2940 | (dotimes (i count) (insert-and-inherit character)) | ||
| 2941 | (dotimes (i count) (insert character)))) | ||
| 2933 | 2942 | ||
| 2934 | (define-key ctl-x-map "8\r" 'ucs-insert) | 2943 | (define-key ctl-x-map "8\r" 'ucs-insert) |
| 2935 | 2944 | ||