From: tomo Date: Tue, 14 Sep 2010 07:34:00 +0000 (+0000) Subject: (allocate_character): New function. X-Git-Tag: chise-base-0_25-1^20~106 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=085e3b534b1dddd627acd2e772d842621c7f823e;p=chise%2Fxemacs-chise.git.1 (allocate_character): New function. (Fdefine_char): Use allocate_character(). --- diff --git a/src/chartab.c b/src/chartab.c index 0b3c130..58bdb92 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -4233,6 +4233,20 @@ implementation does not coalesce ranges all of whose values are the same. return slarg.retval; } +Lisp_Object +allocate_character () +{ + int cid = XINT (Vnext_defined_char_id); + + if (cid <= 0xE00000) + { + Vnext_defined_char_id = make_int (cid + 1); + return make_char (cid); + } + else + return Qnil; +} + DEFUN ("define-char", Fdefine_char, 1, 1, 0, /* Store character's ATTRIBUTES. */ @@ -4281,7 +4295,7 @@ Store character's ATTRIBUTES. } rest = Fcdr (rest); } -#if 1 +#if 0 { int cid = XINT (Vnext_defined_char_id); @@ -4293,16 +4307,9 @@ Store character's ATTRIBUTES. } } #else - if ( (!NILP (code = Fcdr (Fassq (Qto_ucs, attributes)))) ) - { - if (!INTP (code)) - signal_simple_error ("Invalid argument", attributes); - else - character = make_char (XINT (code) + 0x100000); - goto setup_attributes; - } + if ( NILP (character = allocate_character ()) ) #endif - return Qnil; + return Qnil; } else if (!INTP (code)) signal_simple_error ("Invalid argument", attributes);