diff options
| author | Eli Zaretskii | 2022-09-03 13:45:53 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-09-03 13:45:53 +0300 |
| commit | dcfe3314cd78e95d992fe00f757ce906d49586cd (patch) | |
| tree | a3b1a37f04592b6db2dd696f3a5df3be6ccb2676 /src/character.c | |
| parent | db2f8b8415b538ccb43f11a2142567ec6c5451d9 (diff) | |
| download | emacs-dcfe3314cd78e95d992fe00f757ce906d49586cd.tar.gz emacs-dcfe3314cd78e95d992fe00f757ce906d49586cd.zip | |
Teach 'max-char' about the Unicode code range
* src/character.c (Fmax_char): Accept an optional argument
UNICODE, and, if non-nil, return the maximum codepoint defined by
Unicode.
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Update the
signature of 'max-char'.
* etc/NEWS:
* doc/lispref/nonascii.texi (Character Codes): Update the
documentation of 'max-char'.
Diffstat (limited to 'src/character.c')
| -rw-r--r-- | src/character.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/character.c b/src/character.c index 968daccafa7..dc21649b226 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -178,12 +178,14 @@ usage: (characterp OBJECT) */ | |||
| 178 | return (CHARACTERP (object) ? Qt : Qnil); | 178 | return (CHARACTERP (object) ? Qt : Qnil); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0, | 181 | DEFUN ("max-char", Fmax_char, Smax_char, 0, 1, 0, |
| 182 | doc: /* Return the character of the maximum code. */ | 182 | doc: /* Return the maximum character code. |
| 183 | If UNICODE is non-nil, return the maximum character code defined | ||
| 184 | by the Unicode Standard. */ | ||
| 183 | attributes: const) | 185 | attributes: const) |
| 184 | (void) | 186 | (Lisp_Object unicode) |
| 185 | { | 187 | { |
| 186 | return make_fixnum (MAX_CHAR); | 188 | return unicode ? make_fixnum (MAX_UNICODE_CHAR) : make_fixnum (MAX_CHAR); |
| 187 | } | 189 | } |
| 188 | 190 | ||
| 189 | DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte, | 191 | DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte, |