From dcfe3314cd78e95d992fe00f757ce906d49586cd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Sep 2022 13:45:53 +0300 Subject: 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'. --- src/character.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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) */ return (CHARACTERP (object) ? Qt : Qnil); } -DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0, - doc: /* Return the character of the maximum code. */ +DEFUN ("max-char", Fmax_char, Smax_char, 0, 1, 0, + doc: /* Return the maximum character code. +If UNICODE is non-nil, return the maximum character code defined +by the Unicode Standard. */ attributes: const) - (void) + (Lisp_Object unicode) { - return make_fixnum (MAX_CHAR); + return unicode ? make_fixnum (MAX_UNICODE_CHAR) : make_fixnum (MAX_CHAR); } DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte, -- cgit v1.3