changeset 20563:d4de7ffb567d

(buf_bytepos_to_charpos): Use marker bytepos, not bufpos. (buf_charpos_to_bytepos, marker_byte_position): Likewise. (Fset_marker, set_marker_restricted, set_marker_both): Likewise. (set_marker_restricted_both): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Fri, 02 Jan 1998 21:26:05 +0000
parents 33689e29d77c
children 4d06099b7e09
files src/marker.c
diffstat 1 files changed, 9 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/src/marker.c	Fri Jan 02 21:17:27 1998 +0000
+++ b/src/marker.c	Fri Jan 02 21:26:05 1998 +0000
@@ -127,11 +127,7 @@
   tail = BUF_MARKERS (b);
   while (XSYMBOL (tail) != XSYMBOL (Qnil))
     {
-      int i = XMARKER (tail)->bufpos;
-      CONSIDER (XMARKER (tail)->charpos,
-		(i > gapend_byte ? i - BUF_GAP_SIZE (b)
-		 : i > BUF_GPT_BYTE (b) ? BUF_GPT_BYTE (b)
-		 : i));
+      CONSIDER (XMARKER (tail)->charpos, XMARKER (tail)->bytepos);
 
       /* If we are down to a range of 50 chars,
 	 don't bother checking any other markers;
@@ -281,14 +277,7 @@
   tail = BUF_MARKERS (b);
   while (XSYMBOL (tail) != XSYMBOL (Qnil))
     {
-      int marker_bytepos = XMARKER (tail)->bufpos;
-
-      if (marker_bytepos > BUF_GPT_BYTE (b) + BUF_GAP_SIZE (b))
-	marker_bytepos -= BUF_GAP_SIZE (b);
-      else if (marker_bytepos > BUF_GPT_BYTE (b))
-	marker_bytepos = BUF_GPT_BYTE (b);
-
-      CONSIDER (marker_bytepos, XMARKER (tail)->charpos);
+      CONSIDER (XMARKER (tail)->bytepos, XMARKER (tail)->charpos);
 
       /* If we are down to a range of 50 chars,
 	 don't bother checking any other markers;
@@ -441,7 +430,7 @@
   if (MARKERP (position) && b == XMARKER (position)->buffer
       && b == m->buffer)
     {
-      m->bufpos = XMARKER (position)->bufpos;
+      m->bytepos = XMARKER (position)->bytepos;
       m->charpos = XMARKER (position)->charpos;
       return marker;
     }
@@ -461,10 +450,7 @@
   if (charno > bytepos)
     abort ();
 
-  if (bytepos > BUF_GPT_BYTE (b))
-    bytepos += BUF_GAP_SIZE (b);
-
-  m->bufpos = bytepos;
+  m->bytepos = bytepos;
   m->charpos = charno;
 
   if (m->buffer != b)
@@ -520,7 +506,7 @@
   if (MARKERP (pos) && b == XMARKER (pos)->buffer
       && b == m->buffer)
     {
-      m->bufpos = XMARKER (pos)->bufpos;
+      m->bytepos = XMARKER (pos)->bytepos;
       m->charpos = XMARKER (pos)->charpos;
       return marker;
     }
@@ -540,10 +526,7 @@
   if (charno > bytepos)
     abort ();
 
-  if (bytepos > BUF_GPT_BYTE (b))
-    bytepos += BUF_GAP_SIZE (b);
-
-  m->bufpos = bytepos;
+  m->bytepos = bytepos;
   m->charpos = charno;
 
   if (m->buffer != b)
@@ -603,10 +586,7 @@
   if (charpos > bytepos)
     abort ();
 
-  if (bytepos > BUF_GPT_BYTE (b))
-    bytepos += BUF_GAP_SIZE (b);
-
-  m->bufpos = bytepos;
+  m->bytepos = bytepos;
   m->charpos = charpos;
 
   if (m->buffer != b)
@@ -666,10 +646,7 @@
   if (charpos > bytepos)
     abort ();
 
-  if (bytepos > BUF_GPT_BYTE (b))
-    bytepos += BUF_GAP_SIZE (b);
-
-  m->bufpos = bytepos;
+  m->bytepos = bytepos;
   m->charpos = charpos;
 
   if (m->buffer != b)
@@ -759,16 +736,11 @@
 {
   register struct Lisp_Marker *m = XMARKER (marker);
   register struct buffer *buf = m->buffer;
-  register int i = m->bufpos;
+  register int i = m->bytepos;
 
   if (!buf)
     error ("Marker does not point anywhere");
 
-  if (i > BUF_GPT_BYTE (buf) + BUF_GAP_SIZE (buf))
-    i -= BUF_GAP_SIZE (buf);
-  else if (i > BUF_GPT_BYTE (buf))
-    i = BUF_GPT_BYTE (buf);
-
   if (i < BUF_BEG_BYTE (buf) || i > BUF_Z_BYTE (buf))
     abort ();