changeset 19207:be370e94fb42

(Fwiden, Fnarrow_to_region, save_restriction_restore): Don't set clip_changed if the new values are the same as the old.
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 Aug 1997 08:59:08 +0000
parents c21764412813
children 1d24f0a03f75
files src/editfns.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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,