diff options
| author | Richard M. Stallman | 1993-11-25 06:28:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-11-25 06:28:03 +0000 |
| commit | 0b79989fc40a4e7c8b508da1de9e5c76bf47e74b (patch) | |
| tree | 9531545dc3d75dd80890bc3d033f25111b63b074 /src/intervals.c | |
| parent | af9015f93d074a0b2ff220853a5c6dc3370f802a (diff) | |
| download | emacs-0b79989fc40a4e7c8b508da1de9e5c76bf47e74b.tar.gz emacs-0b79989fc40a4e7c8b508da1de9e5c76bf47e74b.zip | |
(graft_intervals_into_buffer): New arg LENGTH.
If source has no intervals, set dest properties to nil.
Diffstat (limited to 'src/intervals.c')
| -rw-r--r-- | src/intervals.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/intervals.c b/src/intervals.c index 59a0cd9a102..3c67f215aa6 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1221,6 +1221,7 @@ make_new_interval (intervals, start, length) | |||
| 1221 | #endif | 1221 | #endif |
| 1222 | 1222 | ||
| 1223 | /* Insert the intervals of SOURCE into BUFFER at POSITION. | 1223 | /* Insert the intervals of SOURCE into BUFFER at POSITION. |
| 1224 | LENGTH is the length of the text in SOURCE. | ||
| 1224 | 1225 | ||
| 1225 | This is used in insdel.c when inserting Lisp_Strings into the | 1226 | This is used in insdel.c when inserting Lisp_Strings into the |
| 1226 | buffer. The text corresponding to SOURCE is already in the buffer | 1227 | buffer. The text corresponding to SOURCE is already in the buffer |
| @@ -1228,7 +1229,8 @@ make_new_interval (intervals, start, length) | |||
| 1228 | belonging to the string being inserted; intervals are never | 1229 | belonging to the string being inserted; intervals are never |
| 1229 | shared. | 1230 | shared. |
| 1230 | 1231 | ||
| 1231 | If the inserted text had no intervals associated, this function | 1232 | If the inserted text had no intervals associated, and we don't |
| 1233 | want to inherit the surrounding text's properties, this function | ||
| 1232 | simply returns -- offset_intervals should handle placing the | 1234 | simply returns -- offset_intervals should handle placing the |
| 1233 | text in the correct interval, depending on the sticky bits. | 1235 | text in the correct interval, depending on the sticky bits. |
| 1234 | 1236 | ||
| @@ -1253,9 +1255,9 @@ make_new_interval (intervals, start, length) | |||
| 1253 | text... */ | 1255 | text... */ |
| 1254 | 1256 | ||
| 1255 | void | 1257 | void |
| 1256 | graft_intervals_into_buffer (source, position, buffer, inherit) | 1258 | graft_intervals_into_buffer (source, position, length, buffer, inherit) |
| 1257 | INTERVAL source; | 1259 | INTERVAL source; |
| 1258 | int position; | 1260 | int position, length; |
| 1259 | struct buffer *buffer; | 1261 | struct buffer *buffer; |
| 1260 | int inherit; | 1262 | int inherit; |
| 1261 | { | 1263 | { |
| @@ -1266,7 +1268,17 @@ graft_intervals_into_buffer (source, position, buffer, inherit) | |||
| 1266 | /* If the new text has no properties, it becomes part of whatever | 1268 | /* If the new text has no properties, it becomes part of whatever |
| 1267 | interval it was inserted into. */ | 1269 | interval it was inserted into. */ |
| 1268 | if (NULL_INTERVAL_P (source)) | 1270 | if (NULL_INTERVAL_P (source)) |
| 1269 | return; | 1271 | { |
| 1272 | Lisp_Object buf; | ||
| 1273 | if (!inherit) | ||
| 1274 | { | ||
| 1275 | XSET (buf, Lisp_Buffer, buffer); | ||
| 1276 | Fset_text_properties (make_number (position), | ||
| 1277 | make_number (position + length), | ||
| 1278 | Qnil, buf); | ||
| 1279 | } | ||
| 1280 | return; | ||
| 1281 | } | ||
| 1270 | 1282 | ||
| 1271 | if (NULL_INTERVAL_P (tree)) | 1283 | if (NULL_INTERVAL_P (tree)) |
| 1272 | { | 1284 | { |