diff options
| author | Chong Yidong | 2012-12-21 15:51:33 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-12-21 15:51:33 +0800 |
| commit | 34b4b7eb7e862ef4e39f5d712757acef421a2c2b (patch) | |
| tree | ea2a5b7d3d8a82311716bcaa45e57d93466e6ab2 /lisp | |
| parent | 3eb050925927e7060cb5ba192bf1d0f954c5980b (diff) | |
| download | emacs-34b4b7eb7e862ef4e39f5d712757acef421a2c2b.tar.gz emacs-34b4b7eb7e862ef4e39f5d712757acef421a2c2b.zip | |
Make read-char-by-name signal an error for invalid input.
* international/mule-cmds.el (read-char-by-name): Signal an error
if the user does not supply a valid character.
* editfns.c (Finsert_char): Since read-char-by-name now signals an
error for invalid chars, don't check for a nil return value.
Fixes: debbugs:13177
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 20 |
2 files changed, 15 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd7dd97315b..a25836da996 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | 5 | ||
| 6 | 2012-12-21 Chong Yidong <cyd@gnu.org> | 6 | 2012-12-21 Chong Yidong <cyd@gnu.org> |
| 7 | 7 | ||
| 8 | * international/mule-cmds.el (read-char-by-name): Signal an error | ||
| 9 | if the user does not supply a valid character (Bug#13177). | ||
| 10 | |||
| 8 | * simple.el (transpose-subr-1): Preserve marker positions by | 11 | * simple.el (transpose-subr-1): Preserve marker positions by |
| 9 | changing the insertion sequence (Bug#13122). | 12 | changing the insertion sequence (Bug#13122). |
| 10 | 13 | ||
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index f324446fa74..07b0f911cb2 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2953,14 +2953,18 @@ point or a number in hash notation, e.g. #o21430 for octal, | |||
| 2953 | (let ((completion-ignore-case t)) | 2953 | (let ((completion-ignore-case t)) |
| 2954 | (if (eq action 'metadata) | 2954 | (if (eq action 'metadata) |
| 2955 | '(metadata (category . unicode-name)) | 2955 | '(metadata (category . unicode-name)) |
| 2956 | (complete-with-action action (ucs-names) string pred))))))) | 2956 | (complete-with-action action (ucs-names) string pred)))))) |
| 2957 | (cond | 2957 | (char |
| 2958 | ((string-match-p "\\`[0-9a-fA-F]+\\'" input) | 2958 | (cond |
| 2959 | (string-to-number input 16)) | 2959 | ((string-match-p "\\`[0-9a-fA-F]+\\'" input) |
| 2960 | ((string-match-p "\\`#" input) | 2960 | (string-to-number input 16)) |
| 2961 | (read input)) | 2961 | ((string-match-p "\\`#" input) |
| 2962 | (t | 2962 | (read input)) |
| 2963 | (cdr (assoc-string input (ucs-names) t)))))) | 2963 | (t |
| 2964 | (cdr (assoc-string input (ucs-names) t)))))) | ||
| 2965 | (unless (characterp char) | ||
| 2966 | (error "Invalid character")) | ||
| 2967 | char)) | ||
| 2964 | 2968 | ||
| 2965 | (define-obsolete-function-alias 'ucs-insert 'insert-char "24.3") | 2969 | (define-obsolete-function-alias 'ucs-insert 'insert-char "24.3") |
| 2966 | (define-key ctl-x-map "8\r" 'insert-char) | 2970 | (define-key ctl-x-map "8\r" 'insert-char) |