(struct closure_for_each_object): Add new member `ret'.
authortomo <tomo>
Tue, 7 Feb 2006 06:24:17 +0000 (06:24 +0000)
committertomo <tomo>
Tue, 7 Feb 2006 06:24:17 +0000 (06:24 +0000)
(func_for_each_object): Setup the return value to
`for_each_object_closure->ret'.
(Fconcord_foreach_object_in_feature): If FUNCTION returns non-nil,
returns the value instead of Qt.

src/concord.c

index 47bf866..e916e27 100644 (file)
@@ -595,6 +595,7 @@ struct closure_for_each_object
   Lisp_Object function;
   Lisp_Object genre;
   Lisp_Object ds;
+  Lisp_Object ret;
 } *for_each_object_closure;
 
 static int
@@ -628,6 +629,7 @@ func_for_each_object (CONCORD_String object_id,
                                 Qnil, Qnil));
 #endif
   ret = call2 (for_each_object_closure->function, obj, val);
+  for_each_object_closure->ret = ret;
   return !NILP (ret);
 }
 
@@ -673,8 +675,10 @@ When the FUNCTION returns non-nil, it breaks the repeat.
   for_each_object_closure->function = function;
   for_each_object_closure->genre = genre;
   for_each_object_closure->ds = ds;
+  for_each_object_closure->ret = Qnil;
   concord_feature_foreach_obj_string (c_feature, func_for_each_object);
-  return Qt;
+  /* return Qt; */
+  return for_each_object_closure->ret;
 }
 
 void