+2001-11-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * ideograph-util.el (insert-ideograph-radical-char-data): Now
+ return value of `char-attribute-list' includes names of
+ CCS-attributes.
+
+ * char-db-util.el (insert-char-attributes): Now return value of
+ `char-attribute-list' includes names of CCS-attributes.
+
2001-11-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
* Ideograph-R140-Grass.el: Merge KS X 1001 code points.
(defun insert-char-attributes (char &optional readable
attributes ccs-attributes
column)
- (setq attributes
- (sort (if attributes
- (if (consp attributes)
- (copy-sequence attributes))
- (char-attribute-list))
- #'char-attribute-name<))
- (setq ccs-attributes
- (sort (if ccs-attributes
- (copy-sequence ccs-attributes)
- (charset-list))
- #'char-attribute-name<))
+ (let (atr-d ccs-d)
+ (setq attributes
+ (sort (if attributes
+ (if (consp attributes)
+ (copy-sequence attributes))
+ (dolist (name (char-attribute-list))
+ (if (find-charset name)
+ (push name ccs-d)
+ (push name atr-d)))
+ atr-d)
+ #'char-attribute-name<))
+ (setq ccs-attributes
+ (sort (if ccs-attributes
+ (copy-sequence ccs-attributes)
+ (or ccs-d
+ (charset-list)))
+ #'char-attribute-name<)))
(unless column
(setq column (current-column)))
(let (name value has-long-ccs-name rest
(let ((chars
(sort (copy-list (aref ideograph-radical-chars-vector radical))
(function ideograph-char<)))
- (attributes (sort (char-attribute-list) #'char-attribute-name<))
- (ccs (sort (charset-list) #'char-attribute-name<)))
+ attributes ccs)
+ (dolist (name (char-attribute-list))
+ (if (find-charset name)
+ (push name ccs)
+ (push name attributes)))
+ (setq attributes (sort attributes #'char-attribute-name<)
+ ccs (sort ccs #'char-attribute-name<))
(aset ideograph-radical-chars-vector radical chars)
(while chars
(insert-char-data (car chars) nil attributes ccs)
+2001-11-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mule-charset.c (put_char_ccs_code_point): Return canonicalized
+ value; don't store value into `encoding_table' of `Lisp_Charset'.
+ (mark_charset): `encoding_table' was deleted.
+ (charset_description): Likewise.
+ (make_charset): Likewise.
+ (Fset_charset_mapping_table): Use `Fput_char_attribute' instead of
+ `put_char_ccs_code_point'.
+
+ * chartab.h (Fput_char_attribute): New EXFUN.
+
+ * chartab.c (Fchar_attribute_alist): Name space of CCS-attributes
+ is unified with normal symbol space.
+ (Fget_char_attribute): Likewise.
+ (Fput_char_attribute): Likewise; behavior of
+ `put_char_ccs_code_point' is changed.
+
+ * char-ucs.h: Include "elhash.h".
+ (Vchar_attribute_hash_table): New external variable.
+ (struct Lisp_Charset): Delete `encoding_table'.
+ (CHARSET_ENCODING_TABLE): New implementation; refer
+ `Vchar_attribute_hash_table' instead of `encoding_table' of struct
+ `Lisp_Charset'.
+
2001-11-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
* mule-charset.c (Fcharset_property): Return Qnil if CHARSET_FINAL
#define INCLUDED_char_ucs_h_
#include "chartab.h"
+#include "elhash.h"
+
+extern Lisp_Object Vchar_attribute_hash_table;
#define valid_char_p(ch) 1
/* Code-point->character mapping table */
Lisp_Object decoding_table;
- /* Character->code-point mapping table */
- Lisp_Object encoding_table;
-
/* Range of character code */
Emchar ucs_min, ucs_max;
#define CHARSET_CHARS(cs) ((cs)->chars)
#define CHARSET_REVERSE_DIRECTION_CHARSET(cs) ((cs)->reverse_direction_charset)
#define CHARSET_DECODING_TABLE(cs) ((cs)->decoding_table)
-#define CHARSET_ENCODING_TABLE(cs) ((cs)->encoding_table)
#define CHARSET_UCS_MIN(cs) ((cs)->ucs_min)
#define CHARSET_UCS_MAX(cs) ((cs)->ucs_max)
#define CHARSET_CODE_OFFSET(cs) ((cs)->code_offset)
#define CHARSET_BYTE_OFFSET(cs) ((cs)->byte_offset)
+INLINE_HEADER Lisp_Object CHARSET_ENCODING_TABLE (Lisp_Charset* cs);
+INLINE_HEADER Lisp_Object
+CHARSET_ENCODING_TABLE (Lisp_Charset* cs)
+{
+ return Fgethash (CHARSET_NAME(cs),
+ Vchar_attribute_hash_table,
+ Qnil);
+}
#define XCHARSET_ID(cs) CHARSET_ID (XCHARSET (cs))
#define XCHARSET_NAME(cs) CHARSET_NAME (XCHARSET (cs))
*/
(character))
{
+ struct gcpro gcpro1;
+ struct char_attribute_alist_closure char_attribute_alist_closure;
Lisp_Object alist = Qnil;
- int i;
CHECK_CHAR (character);
- {
- struct gcpro gcpro1;
- struct char_attribute_alist_closure char_attribute_alist_closure;
-
- GCPRO1 (alist);
- char_attribute_alist_closure.char_id = XCHAR (character);
- char_attribute_alist_closure.char_attribute_alist = &alist;
- elisp_maphash (add_char_attribute_alist_mapper,
- Vchar_attribute_hash_table,
- &char_attribute_alist_closure);
- UNGCPRO;
- }
-
- for (i = 0; i < countof (chlook->charset_by_leading_byte); i++)
- {
- Lisp_Object ccs = chlook->charset_by_leading_byte[i];
- if (!NILP (ccs))
- {
- Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (ccs);
- Lisp_Object cpos;
+ GCPRO1 (alist);
+ char_attribute_alist_closure.char_id = XCHAR (character);
+ char_attribute_alist_closure.char_attribute_alist = &alist;
+ elisp_maphash (add_char_attribute_alist_mapper,
+ Vchar_attribute_hash_table,
+ &char_attribute_alist_closure);
+ UNGCPRO;
- if ( CHAR_TABLEP (encoding_table)
- && INTP (cpos
- = get_char_id_table (XCHAR_TABLE(encoding_table),
- XCHAR (character))) )
- {
- alist = Fcons (Fcons (ccs, cpos), alist);
- }
- }
- }
return alist;
}
*/
(character, attribute, default_value))
{
- Lisp_Object ccs;
+ Lisp_Object table;
CHECK_CHAR (character);
- if (!NILP (ccs = Ffind_charset (attribute)))
- {
- Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (ccs);
- if (CHAR_TABLEP (encoding_table))
- return get_char_id_table (XCHAR_TABLE(encoding_table),
- XCHAR (character));
- }
- else
+ if (CHARSETP (attribute))
+ attribute = XCHARSET_NAME (attribute);
+
+ table = Fgethash (attribute, Vchar_attribute_hash_table,
+ Qunbound);
+ if (!UNBOUNDP (table))
{
- Lisp_Object table = Fgethash (attribute,
- Vchar_attribute_hash_table,
- Qunbound);
- if (!UNBOUNDP (table))
- {
- Lisp_Object ret = get_char_id_table (XCHAR_TABLE(table),
- XCHAR (character));
- if (!UNBOUNDP (ret))
- return ret;
- }
+ Lisp_Object ret = get_char_id_table (XCHAR_TABLE(table),
+ XCHAR (character));
+ if (!UNBOUNDP (ret))
+ return ret;
}
return default_value;
}
*/
(character, attribute, value))
{
- Lisp_Object ccs;
+ Lisp_Object ccs = Ffind_charset (attribute);
- ccs = Ffind_charset (attribute);
if (!NILP (ccs))
{
CHECK_CHAR (character);
- return put_char_ccs_code_point (character, ccs, value);
+ value = put_char_ccs_code_point (character, ccs, value);
}
else if (EQ (attribute, Q_decomposition))
{
EXFUN (Fmake_char, 3);
EXFUN (Fdecode_char, 3);
+EXFUN (Fput_char_attribute, 3);
+
+
/************************************************************************/
/* Char-ID Tables */
/************************************************************************/
put_char_ccs_code_point (Lisp_Object character,
Lisp_Object ccs, Lisp_Object value)
{
- Lisp_Object encoding_table;
-
if (!EQ (XCHARSET_NAME (ccs), Qucs)
+ || !INTP (value)
|| (XCHAR (character) != XINT (value)))
{
Lisp_Object v = XCHARSET_DECODING_TABLE (ccs);
if (VECTORP (v))
{
Lisp_Object cpos = Fget_char_attribute (character, ccs, Qnil);
- if (!NILP (cpos))
+ if (INTP (cpos))
{
decoding_table_remove_char (v, dim, byte_offset, XINT (cpos));
}
decoding_table_put_char (v, dim, byte_offset, code_point, character);
}
- if (NILP (encoding_table = XCHARSET_ENCODING_TABLE (ccs)))
- {
- XCHARSET_ENCODING_TABLE (ccs)
- = encoding_table = make_char_id_table (Qnil);
- }
- put_char_id_table (XCHAR_TABLE(encoding_table), character, value);
- return Qt;
+ return value;
}
Lisp_Object
mark_object (cs->registry);
mark_object (cs->ccl_program);
#ifdef UTF2000
- mark_object (cs->encoding_table);
/* mark_object (cs->decoding_table); */
#endif
return cs->name;
{ XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) },
#ifdef UTF2000
{ XD_LISP_OBJECT, offsetof (Lisp_Charset, decoding_table) },
- { XD_LISP_OBJECT, offsetof (Lisp_Charset, encoding_table) },
#endif
{ XD_END }
};
CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil;
#ifdef UTF2000
CHARSET_DECODING_TABLE(cs) = Qnil;
- CHARSET_ENCODING_TABLE(cs) = Qnil;
CHARSET_UCS_MIN(cs) = ucs_min;
CHARSET_UCS_MAX(cs) = ucs_max;
CHARSET_CODE_OFFSET(cs) = code_offset;
Lisp_Object c = XVECTOR_DATA(table)[i];
if (CHARP (c))
- put_char_ccs_code_point (c, charset,
- make_int (i + byte_offset));
+ Fput_char_attribute (c, XCHARSET_NAME (charset),
+ make_int (i + byte_offset));
}
break;
case 2:
Lisp_Object c = XVECTOR_DATA(v)[j];
if (CHARP (c))
- put_char_ccs_code_point
- (c, charset,
+ Fput_char_attribute
+ (c, XCHARSET_NAME (charset),
make_int ( ( (i + byte_offset) << 8 )
| (j + byte_offset)
) );
}
}
else if (CHARP (v))
- put_char_ccs_code_point (v, charset,
- make_int (i + byte_offset));
+ Fput_char_attribute (v, XCHARSET_NAME (charset),
+ make_int (i + byte_offset));
}
break;
}