comparison src/insdel.c @ 83542:2d56e13fd23d

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-413 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-414 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-415 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-416 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-417 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-418 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-419 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-420 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-421 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-422 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-423 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-424 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-425 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-426 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-427 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-428 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-429 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-430 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-431 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-432 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-433 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-434 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-435 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-436 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-437 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-438 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-439 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-440 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-441 lisp/url/url-methods.el: Fix format error when http_proxy is empty string * emacs@sv.gnu.org/emacs--devo--0--patch-442 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-443 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-444 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-445 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-446 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-447 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-448 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-449 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-450 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-451 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-452 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-453 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-454 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-455 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-456 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-457 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-458 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-459 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-460 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-461 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-462 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-463 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-464 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-465 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-466 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-467 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-468 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-469 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-470 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-471 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-472 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-473 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-128 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-129 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-130 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-131 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-132 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-133 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-134 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-135 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-136 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-137 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-138 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-139 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-140 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-141 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-142 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-143 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-144 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-145 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-146 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-147 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-148 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-149 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 14 Oct 2006 17:36:28 +0000
parents f6de516bbb4b
children 3d45362f1d38 c358d0861b16
comparison
equal deleted inserted replaced
83541:694bbb62a75d 83542:2d56e13fd23d
1005 /* Record deletion of the surrounding text that combines with 1005 /* Record deletion of the surrounding text that combines with
1006 the insertion. This, together with recording the insertion, 1006 the insertion. This, together with recording the insertion,
1007 will add up to the right stuff in the undo list. */ 1007 will add up to the right stuff in the undo list. */
1008 record_insert (PT, nchars); 1008 record_insert (PT, nchars);
1009 MODIFF++; 1009 MODIFF++;
1010 CHARS_MODIFF = MODIFF;
1010 1011
1011 bcopy (string, GPT_ADDR, nbytes); 1012 bcopy (string, GPT_ADDR, nbytes);
1012 1013
1013 GAP_SIZE -= nbytes; 1014 GAP_SIZE -= nbytes;
1014 GPT += nchars; 1015 GPT += nchars;
1142 abort (); 1143 abort ();
1143 #endif 1144 #endif
1144 1145
1145 record_insert (PT, nchars); 1146 record_insert (PT, nchars);
1146 MODIFF++; 1147 MODIFF++;
1148 CHARS_MODIFF = MODIFF;
1147 1149
1148 GAP_SIZE -= outgoing_nbytes; 1150 GAP_SIZE -= outgoing_nbytes;
1149 GPT += nchars; 1151 GPT += nchars;
1150 ZV += nchars; 1152 ZV += nchars;
1151 Z += nchars; 1153 Z += nchars;
1293 abort (); 1295 abort ();
1294 #endif 1296 #endif
1295 1297
1296 record_insert (PT, nchars); 1298 record_insert (PT, nchars);
1297 MODIFF++; 1299 MODIFF++;
1300 CHARS_MODIFF = MODIFF;
1298 1301
1299 GAP_SIZE -= outgoing_nbytes; 1302 GAP_SIZE -= outgoing_nbytes;
1300 GPT += nchars; 1303 GPT += nchars;
1301 ZV += nchars; 1304 ZV += nchars;
1302 Z += nchars; 1305 Z += nchars;
1401 CHECK_MARKERS (); 1404 CHECK_MARKERS ();
1402 1405
1403 if (len == 0) 1406 if (len == 0)
1404 evaporate_overlays (from); 1407 evaporate_overlays (from);
1405 MODIFF++; 1408 MODIFF++;
1409 CHARS_MODIFF = MODIFF;
1406 } 1410 }
1407 1411
1408 /* Like adjust_after_replace, but doesn't require PREV_TEXT. 1412 /* Like adjust_after_replace, but doesn't require PREV_TEXT.
1409 This is for use when undo is not enabled in the current buffer. */ 1413 This is for use when undo is not enabled in the current buffer. */
1410 1414
1451 CHECK_MARKERS (); 1455 CHECK_MARKERS ();
1452 1456
1453 if (len == 0) 1457 if (len == 0)
1454 evaporate_overlays (from); 1458 evaporate_overlays (from);
1455 MODIFF++; 1459 MODIFF++;
1460 CHARS_MODIFF = MODIFF;
1456 } 1461 }
1457 1462
1458 /* Record undo information, adjust markers and position keepers for an 1463 /* Record undo information, adjust markers and position keepers for an
1459 insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The 1464 insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The
1460 text already exists in the current buffer but character length (TO 1465 text already exists in the current buffer but character length (TO
1643 evaporate_overlays (from); 1648 evaporate_overlays (from);
1644 1649
1645 CHECK_MARKERS (); 1650 CHECK_MARKERS ();
1646 1651
1647 MODIFF++; 1652 MODIFF++;
1653 CHARS_MODIFF = MODIFF;
1648 UNGCPRO; 1654 UNGCPRO;
1649 1655
1650 signal_after_change (from, nchars_del, GPT - from); 1656 signal_after_change (from, nchars_del, GPT - from);
1651 update_compositions (from, GPT, CHECK_BORDER); 1657 update_compositions (from, GPT, CHECK_BORDER);
1652 } 1658 }
1767 evaporate_overlays (from); 1773 evaporate_overlays (from);
1768 1774
1769 CHECK_MARKERS (); 1775 CHECK_MARKERS ();
1770 1776
1771 MODIFF++; 1777 MODIFF++;
1778 CHARS_MODIFF = MODIFF;
1772 } 1779 }
1773 1780
1774 /* Delete characters in current buffer 1781 /* Delete characters in current buffer
1775 from FROM up to (but not including) TO. 1782 from FROM up to (but not including) TO.
1776 If TO comes before FROM, we delete nothing. */ 1783 If TO comes before FROM, we delete nothing. */
1948 adjust_markers_for_delete (from, from_byte, to, to_byte); 1955 adjust_markers_for_delete (from, from_byte, to, to_byte);
1949 1956
1950 if (! EQ (current_buffer->undo_list, Qt)) 1957 if (! EQ (current_buffer->undo_list, Qt))
1951 record_delete (from, deletion); 1958 record_delete (from, deletion);
1952 MODIFF++; 1959 MODIFF++;
1960 CHARS_MODIFF = MODIFF;
1953 1961
1954 /* Relocate point as if it were a marker. */ 1962 /* Relocate point as if it were a marker. */
1955 if (from < PT) 1963 if (from < PT)
1956 adjust_point (from - (PT < to ? PT : to), 1964 adjust_point (from - (PT < to ? PT : to),
1957 from_byte - (PT_BYTE < to_byte ? PT_BYTE : to_byte)); 1965 from_byte - (PT_BYTE < to_byte ? PT_BYTE : to_byte));
1988 1996
1989 /* Call this if you're about to change the region of BUFFER from 1997 /* Call this if you're about to change the region of BUFFER from
1990 character positions START to END. This checks the read-only 1998 character positions START to END. This checks the read-only
1991 properties of the region, calls the necessary modification hooks, 1999 properties of the region, calls the necessary modification hooks,
1992 and warns the next redisplay that it should pay attention to that 2000 and warns the next redisplay that it should pay attention to that
1993 area. */ 2001 area.
1994 2002
1995 void 2003 If PRESERVE_CHARS_MODIFF is non-zero, do not update CHARS_MODIFF.
1996 modify_region (buffer, start, end) 2004 Otherwise set CHARS_MODIFF to the new value of MODIFF. */
2005
2006 void
2007 modify_region (buffer, start, end, preserve_chars_modiff)
1997 struct buffer *buffer; 2008 struct buffer *buffer;
1998 int start, end; 2009 int start, end, preserve_chars_modiff;
1999 { 2010 {
2000 struct buffer *old_buffer = current_buffer; 2011 struct buffer *old_buffer = current_buffer;
2001 2012
2002 if (buffer != old_buffer) 2013 if (buffer != old_buffer)
2003 set_buffer_internal (buffer); 2014 set_buffer_internal (buffer);
2007 BUF_COMPUTE_UNCHANGED (buffer, start - 1, end); 2018 BUF_COMPUTE_UNCHANGED (buffer, start - 1, end);
2008 2019
2009 if (MODIFF <= SAVE_MODIFF) 2020 if (MODIFF <= SAVE_MODIFF)
2010 record_first_change (); 2021 record_first_change ();
2011 MODIFF++; 2022 MODIFF++;
2023 if (! preserve_chars_modiff)
2024 CHARS_MODIFF = MODIFF;
2012 2025
2013 buffer->point_before_scroll = Qnil; 2026 buffer->point_before_scroll = Qnil;
2014 2027
2015 if (buffer != old_buffer) 2028 if (buffer != old_buffer)
2016 set_buffer_internal (old_buffer); 2029 set_buffer_internal (old_buffer);