@cindex maximum value of character codepoint
@cindex codepoint, largest value
-@defun max-char
+@defun max-char &optional unicode
This function returns the largest value that a valid character
-codepoint can have.
+codepoint can have in Emacs. If the optional argument @var{unicode}
+is non-@code{nil}, it returns the largest character codepoint defined
+by the Unicode Standard (which is smaller than the maximum codepoint
+supported by Emacs).
@example
@group
+++
** New macro 'with-memoization' provides a very primitive form of memoization.
++++
+** 'max-char' can now report the maximum codepoint according to Unicode.
+When called with a new optional argument UNICODE non-nil, 'max-char'
+will now report the maximum valid codepoint defined by the Unicode
+Standard.
+
** Themes
---
(marker-buffer (function (marker) (or buffer null)))
(markerp (function (t) boolean))
(max (function ((or number marker) &rest (or number marker)) number))
- (max-char (function () fixnum))
+ (max-char (function (&optional t) fixnum))
(member (function (t list) list))
(memory-limit (function () integer))
(memq (function (t list) list))
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,