diff options
| author | Richard M. Stallman | 2002-01-11 21:29:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-01-11 21:29:13 +0000 |
| commit | b58e3ca17e2cca5fb0badc17e2df5bba0d9129d3 (patch) | |
| tree | 722cb45729943c875c10c04fa7075624a5516453 | |
| parent | 72d1a715ee9611f5cf3fbb0417106daecc8addf3 (diff) | |
| download | emacs-b58e3ca17e2cca5fb0badc17e2df5bba0d9129d3.tar.gz emacs-b58e3ca17e2cca5fb0badc17e2df5bba0d9129d3.zip | |
(adjust_after_replace_noundo): New function.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | src/insdel.c | 50 |
2 files changed, 58 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 08cb1f1f94d..27913f5d60d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2002-01-11 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmail.el (rmail-decode-babyl-format): Disable undo | ||
| 4 | around the decode-coding-region call. | ||
| 5 | |||
| 6 | * emacs-lisp/lisp.el (lisp-complete-symbol): Repeating the command | ||
| 7 | after displaying a completion list scrolls the list. | ||
| 8 | |||
| 1 | 2002-01-11 Eli Zaretskii <eliz@is.elta.co.il> | 9 | 2002-01-11 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 10 | ||
| 3 | * version.el (emacs-version): Bump to 21.2.50. | 11 | * version.el (emacs-version): Bump to 21.2.50. |
diff --git a/src/insdel.c b/src/insdel.c index a71afb7258d..486875d2b91 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1391,6 +1391,56 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte) | |||
| 1391 | MODIFF++; | 1391 | MODIFF++; |
| 1392 | } | 1392 | } |
| 1393 | 1393 | ||
| 1394 | /* Like adjust_after_replace, but doesn't require PREV_TEXT. | ||
| 1395 | This is for use when undo is not enabled in the current buffer. */ | ||
| 1396 | |||
| 1397 | void | ||
| 1398 | adjust_after_replace_noundo (from, from_byte, nchars_del, nbytes_del, len, len_byte) | ||
| 1399 | int from, from_byte, nchars_del, nbytes_del, len, len_byte; | ||
| 1400 | { | ||
| 1401 | #ifdef BYTE_COMBINING_DEBUG | ||
| 1402 | if (count_combining_before (GPT_ADDR, len_byte, from, from_byte) | ||
| 1403 | || count_combining_after (GPT_ADDR, len_byte, from, from_byte)) | ||
| 1404 | abort (); | ||
| 1405 | #endif | ||
| 1406 | |||
| 1407 | /* Update various buffer positions for the new text. */ | ||
| 1408 | GAP_SIZE -= len_byte; | ||
| 1409 | ZV += len; Z+= len; | ||
| 1410 | ZV_BYTE += len_byte; Z_BYTE += len_byte; | ||
| 1411 | GPT += len; GPT_BYTE += len_byte; | ||
| 1412 | if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ | ||
| 1413 | |||
| 1414 | if (nchars_del > 0) | ||
| 1415 | adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, | ||
| 1416 | len, len_byte); | ||
| 1417 | else | ||
| 1418 | adjust_markers_for_insert (from, from_byte, | ||
| 1419 | from + len, from_byte + len_byte, 0); | ||
| 1420 | |||
| 1421 | if (len > nchars_del) | ||
| 1422 | adjust_overlays_for_insert (from, len - nchars_del); | ||
| 1423 | else if (len < nchars_del) | ||
| 1424 | adjust_overlays_for_delete (from, nchars_del - len); | ||
| 1425 | if (BUF_INTERVALS (current_buffer) != 0) | ||
| 1426 | { | ||
| 1427 | offset_intervals (current_buffer, from, len - nchars_del); | ||
| 1428 | } | ||
| 1429 | |||
| 1430 | if (from < PT) | ||
| 1431 | adjust_point (len - nchars_del, len_byte - nbytes_del); | ||
| 1432 | |||
| 1433 | /* As byte combining will decrease Z, we must check this again. */ | ||
| 1434 | if (Z - GPT < END_UNCHANGED) | ||
| 1435 | END_UNCHANGED = Z - GPT; | ||
| 1436 | |||
| 1437 | CHECK_MARKERS (); | ||
| 1438 | |||
| 1439 | if (len == 0) | ||
| 1440 | evaporate_overlays (from); | ||
| 1441 | MODIFF++; | ||
| 1442 | } | ||
| 1443 | |||
| 1394 | /* Record undo information, adjust markers and position keepers for an | 1444 | /* Record undo information, adjust markers and position keepers for an |
| 1395 | insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The | 1445 | insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The |
| 1396 | text already exists in the current buffer but character length (TO | 1446 | text already exists in the current buffer but character length (TO |