X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ftextprop.c;h=40705e50db2422284de795eff2fcc3997ce4390e;hb=c42974a7971c8d3bcd6e9356418d3f2182f7b08b;hp=42a026afaf898c602a420c896718fb928e471b8a;hpb=68ce3967e926ad341df6171f8abe6bdd954cf3c7;p=m17n%2Fm17n-lib.git
diff --git a/src/textprop.c b/src/textprop.c
index 42a026a..40705e5 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -32,8 +32,8 @@
application programs can be simple.
A text property consists of a @e key and @e values, where key is a
- symbol and values are anything that can be cast to (void
- *). Unlike other types of properties, a text property can
+ symbol and values are anything that can be cast to (void *)
+ . Unlike other types of properties, a text property can
have multiple values. "The text property whose key is K" may be
shortened to "K property". */
@@ -1429,6 +1429,20 @@ mtext__adjust_plist_for_insert (MText *mt, int pos, int nchars,
}
}
+void
+mtext__adjust_plist_for_change (MText *mt, int from, int to)
+{
+ MTextPlist *plist;
+
+ prepare_to_modify (mt, from, to, Mnil);
+ for (plist = mt->plist; plist; plist = plist->next)
+ {
+ pop_all_properties (plist, from, to);
+ xassert (check_plist (plist, 0) == 0);
+ }
+}
+
+
/*** @} */
#endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
@@ -1519,7 +1533,7 @@ mtext_get_prop (MText *mt, int pos, MSymbol key)
/*=*/
/***en
- @brief Get multiple values of a text property
+ @brief Get multiple values of a text property.
The mtext_get_prop_values () function searches the character at
$POS in M-text $MT for the property whose key is $KEY. If such
@@ -1823,7 +1837,7 @@ mtext_put_prop_values (MText *mt, int from, int to,
The mtext_push_prop () function pushes a text property whose key
is $KEY and value is $VAL to the characters between $FROM
- (inclusive) and $TO (exclusive) in $MT. With this functio,
+ (inclusive) and $TO (exclusive) in $MT. With this function,
@verbatim
FROM TO
@@ -1970,7 +1984,7 @@ mtext_push_prop (MText *mt, int from, int to,
/*=*/
/***en
- @brief Pop a text property
+ @brief Pop a text property.
The mtext_pop_prop () function removes the topmost text property
whose key is $KEY from the characters between $FROM (inclusive)
@@ -2480,6 +2494,7 @@ mtext_get_properties (MText *mt, int pos, MSymbol key,
¤ì¤Ð -1 ¤òÊÖ¤·¤Æ³°ÉôÊÑ¿ô#merror_code ¤Ë¥¨¥é¡¼¥³¡¼¥É¤òÀßÄꤹ¤ë¡£ */
+int
mtext_attach_property (MText *mt, int from, int to, MTextProperty *prop)
{
MTextPlist *plist;
@@ -2518,7 +2533,7 @@ mtext_attach_property (MText *mt, int from, int to, MTextProperty *prop)
@return
This function always returns 0. */
/***ja
- @brief M-text ¤«¤é¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òʬΥ¤¹¤ë¡£
+ @brief M-text ¤«¤é¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òʬΥ¤¹¤ë.
´Ø¿ô mtext_detach_property () ¤Ï¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ $PROP ¤òʬΥ¤¹¤ë¡£