diff options
| author | Richard M. Stallman | 1994-08-28 06:07:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-28 06:07:37 +0000 |
| commit | cd11ef314d82cf6d6ae494db0b2877da12559093 (patch) | |
| tree | 33fbd81c521826c266fe28f01875497951faed06 /src | |
| parent | e2eeabbbce46812614429c7a20bfb3d43acd1ef9 (diff) | |
| download | emacs-cd11ef314d82cf6d6ae494db0b2877da12559093.tar.gz emacs-cd11ef314d82cf6d6ae494db0b2877da12559093.zip | |
(insert_1): New arg INHERIT.
(insert_and_inherit): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/insdel.c b/src/insdel.c index 5ddf391b863..d368cd86ac1 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -309,15 +309,27 @@ insert (string, length) | |||
| 309 | { | 309 | { |
| 310 | if (length > 0) | 310 | if (length > 0) |
| 311 | { | 311 | { |
| 312 | insert_1 (string, length); | 312 | insert_1 (string, length, 0); |
| 313 | signal_after_change (PT-length, 0, length); | ||
| 314 | } | ||
| 315 | } | ||
| 316 | |||
| 317 | insert_and_inherit (string, length) | ||
| 318 | register unsigned char *string; | ||
| 319 | register length; | ||
| 320 | { | ||
| 321 | if (length > 0) | ||
| 322 | { | ||
| 323 | insert_1 (string, length, 1); | ||
| 313 | signal_after_change (PT-length, 0, length); | 324 | signal_after_change (PT-length, 0, length); |
| 314 | } | 325 | } |
| 315 | } | 326 | } |
| 316 | 327 | ||
| 317 | static void | 328 | static void |
| 318 | insert_1 (string, length) | 329 | insert_1 (string, length, inherit) |
| 319 | register unsigned char *string; | 330 | register unsigned char *string; |
| 320 | register length; | 331 | register length; |
| 332 | int inherit; | ||
| 321 | { | 333 | { |
| 322 | register Lisp_Object temp; | 334 | register Lisp_Object temp; |
| 323 | 335 | ||
| @@ -346,6 +358,10 @@ insert_1 (string, length) | |||
| 346 | ZV += length; | 358 | ZV += length; |
| 347 | Z += length; | 359 | Z += length; |
| 348 | adjust_point (length); | 360 | adjust_point (length); |
| 361 | |||
| 362 | if (!inherit) | ||
| 363 | Fset_text_properties (make_number (PT - length), make_number (PT), | ||
| 364 | Qnil, Qnil); | ||
| 349 | } | 365 | } |
| 350 | 366 | ||
| 351 | /* Insert the part of the text of STRING, a Lisp object assumed to be | 367 | /* Insert the part of the text of STRING, a Lisp object assumed to be |
| @@ -442,7 +458,7 @@ insert_before_markers (string, length) | |||
| 442 | if (length > 0) | 458 | if (length > 0) |
| 443 | { | 459 | { |
| 444 | register int opoint = PT; | 460 | register int opoint = PT; |
| 445 | insert_1 (string, length); | 461 | insert_1 (string, length, 1); |
| 446 | adjust_markers (opoint - 1, opoint, length); | 462 | adjust_markers (opoint - 1, opoint, length); |
| 447 | signal_after_change (PT-length, 0, length); | 463 | signal_after_change (PT-length, 0, length); |
| 448 | } | 464 | } |