# HG changeset patch # User Richard M. Stallman # Date 870944348 0 # Node ID be370e94fb422f83f390ac703118d8171b1af565 # Parent c2176441281352ccb8a1ff5f5da66876cb5306d8 (Fwiden, Fnarrow_to_region, save_restriction_restore): Don't set clip_changed if the new values are the same as the old. diff -r c21764412813 -r be370e94fb42 src/editfns.c --- a/src/editfns.c Thu Aug 07 08:56:22 1997 +0000 +++ b/src/editfns.c Thu Aug 07 08:59:08 1997 +0000 @@ -1895,9 +1895,10 @@ This allows the buffer's full text to be seen and edited.") () { + if (BEG != BEGV || Z != ZV) + current_buffer->clip_changed = 1; BEGV = BEG; SET_BUF_ZV (current_buffer, Z); - current_buffer->clip_changed = 1; /* Changing the buffer bounds invalidates any recorded current column. */ invalidate_current_column (); return Qnil; @@ -1927,13 +1928,15 @@ if (!(BEG <= XINT (start) && XINT (start) <= XINT (end) && XINT (end) <= Z)) args_out_of_range (start, end); + if (BEGV != XFASTINT (start) || ZV != XFASTINT (end)) + current_buffer->clip_changed = 1; + BEGV = XFASTINT (start); SET_BUF_ZV (current_buffer, XFASTINT (end)); if (PT < XFASTINT (start)) SET_PT (XFASTINT (start)); if (PT > XFASTINT (end)) SET_PT (XFASTINT (end)); - current_buffer->clip_changed = 1; /* Changing the buffer bounds invalidates any recorded current column. */ invalidate_current_column (); return Qnil; @@ -1959,6 +1962,7 @@ register struct buffer *buf; register int newhead, newtail; register Lisp_Object tem; + int obegv, ozv; buf = XBUFFER (XCONS (data)->car); @@ -1973,9 +1977,15 @@ newhead = 0; newtail = 0; } + + obegv = BUF_BEGV (buf); + ozv = BUF_ZV (buf); + BUF_BEGV (buf) = BUF_BEG (buf) + newhead; SET_BUF_ZV (buf, BUF_Z (buf) - newtail); - current_buffer->clip_changed = 1; + + if (obegv != BUF_BEGV (buf) || ozv != BUF_ZV (buf)) + current_buffer->clip_changed = 1; /* If point is outside the new visible range, move it inside. */ SET_BUF_PT (buf,