From: tomo Date: Wed, 21 Jun 2006 15:34:23 +0000 (+0000) Subject: (Fconcord_define_object): New function. X-Git-Tag: r21-4-19-chise-0_23-2^20~54 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aa149bc9e46f79e626a2e3dd36e83fa706bf79bb;p=chise%2Fxemacs-chise.git (Fconcord_define_object): New function. (syms_of_concord): Add new builtin function `concord-define-object'. --- diff --git a/src/concord.c b/src/concord.c index 81c6469..f8b37c8 100644 --- a/src/concord.c +++ b/src/concord.c @@ -779,6 +779,31 @@ Return the spec of OBJECT. return concord_object_spec_closure->spec; } +DEFUN ("concord-define-object", Fconcord_define_object, 2, 3, 0, /* +Define an object of which spec is a set of features SPEC. +*/ + (spec, genre, ds)) +{ + Lisp_Object id = Fcdr (Fassq (Q_id, spec)); + Lisp_Object obj; + + if (!NILP (id)) + { + Lisp_Object rest = spec; + Lisp_Object cell; + + obj = Fconcord_make_object (genre, id, ds); + while (!NILP (rest)) + { + cell = Fcar (rest); + Fconcord_object_put (obj, Fcar (cell), Fcdr (cell)); + rest = Fcdr (rest); + } + return obj; + } + return Qnil; +} + struct closure_for_each_object { Lisp_Object function; @@ -990,6 +1015,7 @@ syms_of_concord (void) DEFSUBR (Fconcord_decode_object); DEFSUBR (Fconcord_object_get); DEFSUBR (Fconcord_object_put); + DEFSUBR (Fconcord_define_object); DEFSUBR (Fconcord_object_spec); DEFSUBR (Fconcord_foreach_object_in_feature); }