]> code.delx.au - gnu-emacs/commitdiff
(set_point): Use virtual bounds, not real bounds,
authorRichard M. Stallman <rms@gnu.org>
Wed, 18 Dec 1996 06:30:59 +0000 (06:30 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 18 Dec 1996 06:30:59 +0000 (06:30 +0000)
in the abort test for POSITION.
Skip the intangibility test if POSITION is at either end of buffer.

src/intervals.c

index 1e5a3782ef9d6c1b86cc373233ad2b307a1fed12..de5e3b30f5d7e4d95e25fe0ebb6a958f82b41180 100644 (file)
@@ -1613,7 +1613,7 @@ set_point (position, buffer)
   /* Check this now, before checking if the buffer has any intervals.
      That way, we can catch conditions which break this sanity check
      whether or not there are intervals in the buffer.  */
-  if (position > BUF_Z (buffer) || position < BUF_BEG (buffer))
+  if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer))
     abort ();
 
   have_overlays = (! NILP (buffer->overlays_before)
@@ -1671,7 +1671,10 @@ set_point (position, buffer)
      move forward or backward until a change in that property.  */
   if (NILP (Vinhibit_point_motion_hooks)
       && ((! NULL_INTERVAL_P (to) && ! NULL_INTERVAL_P (toprev))
-         || have_overlays))
+         || have_overlays)
+      /* Intangibility never stops us from positioning at the beginning
+        or end of the buffer, so don't bother checking in that case.  */
+      && position != BEGV && position != ZV)
     {
       Lisp_Object intangible_propval;
       Lisp_Object pos;