APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1552240956 0
# Sun Mar 10 18:02:36 2019 +0000
# Node ID 9061f6baa93095d8fbd6b487a4ef8f12acc620c4
# Parent 5d1f8a39a8d09a49b87b25c7b27b09fa8b3059c0
Mechanically change byte_marker_position() to marker_byte_position().
2019-03-10 Aidan Kehoe <kehoea(a)parhasard.net>
Mechanically change byte_marker_position() to
marker_byte_position(), the GNU name for the same function, in our
C sources.
Include set_byte_marker_position() -> set_marker_byte_position()
in this for symmetry, despite that GNU doesn't use the latter
name.
* bytecode.c (bytecode_arithcompare):
* bytecode.c (bytecode_gtr):
* bytecode.c (bytecode_lss):
* bytecode.c (bytecode_leq):
* bytecode.c (bytecode_geq):
* bytecode.c (bytecode_arithop):
* callint.c (check_mark):
* callint.c (callint_prompt):
* data.c (ARITHCOMPARE_MANY):
* data.c (Fmax):
* data.c (Fmin):
* editfns.c (region_limit):
* editfns.c (Fpoint_min_marker):
* editfns.c (Fpoint_max_marker):
* editfns.c (save_restriction_save):
* editfns.c (save_restriction_restore):
* extents.h:
* fileio.c:
* fileio.c (restore_point_unwind):
* line-number.c (invalidate_line_number_cache):
* line-number.c (get_nearest_line_number):
* line-number.c (add_position_to_cache):
* lisp.h:
* lread.c (readchar):
* lread.c (unreadchar):
* lstream.c (lisp_buffer_reader):
* lstream.c (lisp_buffer_rewinder):
* lstream.c (lisp_buffer_marker):
* marker.c (set_byte_marker_position):
* marker.c (byte_marker_position):
* marker.c (copy_marker_1):
* print.c (output_string):
* redisplay-output.c (redisplay_move_cursor):
* redisplay-output.c (redisplay_update_line):
* redisplay-output.c (redisplay_output_window):
* redisplay.c (generate_display_line):
* redisplay.c (create_text_block):
* redisplay.c (regenerate_window_extents_only_changed):
* redisplay.c (redisplay_window):
* redisplay.c (decode_mode_spec):
* syntax.c (signal_syntax_cache_extent_changed):
* text.c (get_buffer_pos_byte):
* window.c (Fset_window_start):
* window.c (unshow_buffer):
* window.c (Fdelete_other_windows):
* window.c (Fset_window_buffer):
* window.c (window_scroll):
* window.c (Fcenter_to_window_line):
* window.c (Fmove_to_window_line):
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/ChangeLog
--- a/src/ChangeLog Sun Mar 10 17:24:04 2019 +0000
+++ b/src/ChangeLog Sun Mar 10 18:02:36 2019 +0000
@@ -1,3 +1,61 @@
+2019-03-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Mechanically change byte_marker_position() to
+ marker_byte_position(), the GNU name for the same function, in our
+ C sources.
+ Include set_byte_marker_position() -> set_marker_byte_position()
+ in this for symmetry, despite that GNU doesn't use the latter
+ name.
+ * bytecode.c (bytecode_arithcompare):
+ * bytecode.c (bytecode_gtr):
+ * bytecode.c (bytecode_lss):
+ * bytecode.c (bytecode_leq):
+ * bytecode.c (bytecode_geq):
+ * bytecode.c (bytecode_arithop):
+ * callint.c (check_mark):
+ * callint.c (callint_prompt):
+ * data.c (ARITHCOMPARE_MANY):
+ * data.c (Fmax):
+ * data.c (Fmin):
+ * editfns.c (region_limit):
+ * editfns.c (Fpoint_min_marker):
+ * editfns.c (Fpoint_max_marker):
+ * editfns.c (save_restriction_save):
+ * editfns.c (save_restriction_restore):
+ * extents.h:
+ * fileio.c:
+ * fileio.c (restore_point_unwind):
+ * line-number.c (invalidate_line_number_cache):
+ * line-number.c (get_nearest_line_number):
+ * line-number.c (add_position_to_cache):
+ * lisp.h:
+ * lread.c (readchar):
+ * lread.c (unreadchar):
+ * lstream.c (lisp_buffer_reader):
+ * lstream.c (lisp_buffer_rewinder):
+ * lstream.c (lisp_buffer_marker):
+ * marker.c (set_byte_marker_position):
+ * marker.c (byte_marker_position):
+ * marker.c (copy_marker_1):
+ * print.c (output_string):
+ * redisplay-output.c (redisplay_move_cursor):
+ * redisplay-output.c (redisplay_update_line):
+ * redisplay-output.c (redisplay_output_window):
+ * redisplay.c (generate_display_line):
+ * redisplay.c (create_text_block):
+ * redisplay.c (regenerate_window_extents_only_changed):
+ * redisplay.c (redisplay_window):
+ * redisplay.c (decode_mode_spec):
+ * syntax.c (signal_syntax_cache_extent_changed):
+ * text.c (get_buffer_pos_byte):
+ * window.c (Fset_window_start):
+ * window.c (unshow_buffer):
+ * window.c (Fdelete_other_windows):
+ * window.c (Fset_window_buffer):
+ * window.c (window_scroll):
+ * window.c (Fcenter_to_window_line):
+ * window.c (Fmove_to_window_line):
+
2019-03-10 Aidan Kehoe <kehoea(a)parhasard.net>
Make the modiff, save_modiff, face_change, auto_save_modified
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/bytecode.c
--- a/src/bytecode.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/bytecode.c Sun Mar 10 18:02:36 2019 +0000
@@ -310,8 +310,8 @@
#endif
case LAZY_MARKER_T:
{
- Bytebpos ival1 = byte_marker_position (obj1);
- Bytebpos ival2 = byte_marker_position (obj2);
+ Bytebpos ival1 = marker_byte_position (obj1);
+ Bytebpos ival2 = marker_byte_position (obj2);
return ival1 < ival2 ? -1 : ival1 > ival2 ? 1 : 0;
}
@@ -335,8 +335,8 @@
if (MARKERP (obj2)
&& (XMARKER (obj1)->buffer == XMARKER (obj2)->buffer))
{
- Bytebpos bpval1 = byte_marker_position (obj1);
- Bytebpos bpval2 = byte_marker_position (obj2);
+ Bytebpos bpval1 = marker_byte_position (obj1);
+ Bytebpos bpval2 = marker_byte_position (obj2);
return bpval1 < bpval2 ? -1 : bpval1 > bpval2 ? 1 : 0;
}
@@ -393,7 +393,7 @@
{
if (MARKERP (obj1) && FIXNUMP (obj2))
{
- const Bytebpos pos1 = byte_marker_position (obj1);
+ const Bytebpos pos1 = marker_byte_position (obj1);
const Charbpos cpos1min = LOWER_CHAR_BOUND (obj1, pos1);
/* (POS1 / MAX_ICHAR_LEN) is a lower bound on OBJ1's character length,
@@ -412,7 +412,7 @@
}
else if (FIXNUMP (obj1) && MARKERP (obj2))
{
- const Bytebpos pos2 = byte_marker_position (obj2);
+ const Bytebpos pos2 = marker_byte_position (obj2);
const Charbpos cpos2min = LOWER_CHAR_BOUND (obj2, pos2);
/* The byte marker position is an upper limit on the character marker
@@ -444,7 +444,7 @@
/* See bytecode_gtr() for the reasoning for the following. */
if (MARKERP (obj1) && FIXNUMP (obj2))
{
- const Bytebpos pos1 = byte_marker_position (obj1);
+ const Bytebpos pos1 = marker_byte_position (obj1);
const Charbpos cpos1min = LOWER_CHAR_BOUND (obj1, pos1);
if (pos1 < XFIXNUM (obj2))
@@ -458,7 +458,7 @@
}
else if (FIXNUMP (obj1) && MARKERP (obj2))
{
- const Bytebpos pos2 = byte_marker_position (obj2);
+ const Bytebpos pos2 = marker_byte_position (obj2);
const Charbpos cpos2min = LOWER_CHAR_BOUND (obj2, pos2);
if (XFIXNUM (obj1) < cpos2min)
@@ -480,7 +480,7 @@
/* See bytecode_gtr() for the reasoning for the following. */
if (MARKERP (obj1) && FIXNUMP (obj2))
{
- const Bytebpos pos1 = byte_marker_position (obj1);
+ const Bytebpos pos1 = marker_byte_position (obj1);
const Charbpos cpos1min = LOWER_CHAR_BOUND (obj1, pos1);
if (pos1 <= XREALFIXNUM (obj2))
@@ -494,7 +494,7 @@
}
else if (FIXNUMP (obj1) && MARKERP (obj2))
{
- const Bytebpos pos2 = byte_marker_position (obj2);
+ const Bytebpos pos2 = marker_byte_position (obj2);
const Charbpos cpos2min = LOWER_CHAR_BOUND (obj2, pos2);
if (XREALFIXNUM (obj1) <= cpos2min)
@@ -516,7 +516,7 @@
/* See bytecode_gtr() for the reasoning for the following. */
if (MARKERP (obj1) && FIXNUMP (obj2))
{
- const Bytebpos pos1 = byte_marker_position (obj1);
+ const Bytebpos pos1 = marker_byte_position (obj1);
const Charbpos cpos1min = LOWER_CHAR_BOUND (obj1, pos1);
if (cpos1min >= XREALFIXNUM (obj2))
@@ -530,7 +530,7 @@
}
else if (FIXNUMP (obj1) && MARKERP (obj2))
{
- const Bytebpos pos2 = byte_marker_position (obj2);
+ const Bytebpos pos2 = marker_byte_position (obj2);
const Charbpos cpos2min = LOWER_CHAR_BOUND (obj2, pos2);
if (XREALFIXNUM (obj1) >= pos2)
@@ -557,10 +557,10 @@
switch (opcode)
{
case Bmax:
- return byte_marker_position (obj1) < byte_marker_position (obj2)
+ return marker_byte_position (obj1) < marker_byte_position (obj2)
? obj2 : obj1;
case Bmin:
- return byte_marker_position (obj1) > byte_marker_position (obj2)
+ return marker_byte_position (obj1) > marker_byte_position (obj2)
? obj2 : obj1;
default:
obj1 = make_fixnum (marker_position (obj1));
@@ -722,12 +722,12 @@
{
if (opcode == Bmax)
{
- return byte_marker_position (obj1) < byte_marker_position (obj2)
+ return marker_byte_position (obj1) < marker_byte_position (obj2)
? obj2 : obj1;
}
else if (opcode == Bmin)
{
- return byte_marker_position (obj1) > byte_marker_position (obj2)
+ return marker_byte_position (obj1) > marker_byte_position (obj2)
? obj2 : obj1;
}
/* Otherwise, convert to a fixnum in the normal way. */
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/callint.c
--- a/src/callint.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/callint.c Sun Mar 10 18:02:36 2019 +0000
@@ -232,7 +232,7 @@
if (NILP (tem) || (XBUFFER (tem) != current_buffer))
invalid_operation ("The mark is not set now", Qunbound);
- return byte_marker_position (current_buffer->mark);
+ return marker_byte_position (current_buffer->mark);
}
static Lisp_Object
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/data.c
--- a/src/data.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/data.c Sun Mar 10 18:02:36 2019 +0000
@@ -871,8 +871,8 @@
break; \
BIGFLOAT_CASE (op) \
case LAZY_MARKER_T: \
- if (!(byte_marker_position (obj1) c_op \
- byte_marker_position (obj2))) \
+ if (!(marker_byte_position (obj1) c_op \
+ marker_byte_position (obj2))) \
return Qnil; \
break; \
} \
@@ -2474,8 +2474,8 @@
switch (promote_args_lazy (args + maxindex, args + i))
{
case LAZY_MARKER_T:
- if (byte_marker_position (args[maxindex])
- < byte_marker_position (args[i]))
+ if (marker_byte_position (args[maxindex])
+ < marker_byte_position (args[i]))
maxindex = i;
break;
case LAZY_FIXNUM_T:
@@ -2534,8 +2534,8 @@
if (MARKERP (obj2)
&& (XMARKER (max_so_far)->buffer == XMARKER (obj2)->buffer))
{
- if (byte_marker_position (max_so_far)
- < byte_marker_position (obj2))
+ if (marker_byte_position (max_so_far)
+ < marker_byte_position (obj2))
{
max_so_far = obj2;
}
@@ -2606,8 +2606,8 @@
switch (promote_args_lazy (args + minindex, args + i))
{
case LAZY_MARKER_T:
- if (byte_marker_position (args[minindex])
- > byte_marker_position (args[i]))
+ if (marker_byte_position (args[minindex])
+ > marker_byte_position (args[i]))
minindex = i;
break;
case LAZY_FIXNUM_T:
@@ -2667,8 +2667,8 @@
if (MARKERP (obj2)
&& (XMARKER (min_so_far)->buffer == XMARKER (obj2)->buffer))
{
- if (byte_marker_position (min_so_far)
- > byte_marker_position (obj2))
+ if (marker_byte_position (min_so_far)
+ > marker_byte_position (obj2))
{
min_so_far = obj2;
}
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/editfns.c
--- a/src/editfns.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/editfns.c Sun Mar 10 18:02:36 2019 +0000
@@ -204,7 +204,7 @@
{
invalid_operation ("There is no region now", Qunbound);
}
- if (!!(BYTE_BUF_PT (b) < byte_marker_position (b->mark)) == !!beginningp)
+ if (!!(BYTE_BUF_PT (b) < marker_byte_position (b->mark)) == !!beginningp)
return make_fixnum (BUF_PT (b));
else
return Fmarker_position (b->mark);
@@ -431,7 +431,7 @@
(buffer))
{
struct buffer *b = decode_buffer (buffer, 1);
- return set_byte_marker_position (Fmake_marker (), BYTE_BUF_BEGV (b),
+ return set_marker_byte_position (Fmake_marker (), BYTE_BUF_BEGV (b),
wrap_buffer (b));
}
@@ -456,7 +456,7 @@
(buffer))
{
struct buffer *b = decode_buffer (buffer, 1);
- return set_byte_marker_position (Fmake_marker (), BYTE_BUF_ZV (b),
+ return set_marker_byte_position (Fmake_marker (), BYTE_BUF_ZV (b),
wrap_buffer (b));
}
@@ -2147,8 +2147,8 @@
But that was clearly before the advent of marker-insertion-type. --ben */
- set_byte_marker_position (bottom, BYTE_BUF_BEGV (buf), wrap_buffer (buf));
- set_byte_marker_position (top, BYTE_BUF_ZV (buf), wrap_buffer (buf));
+ set_marker_byte_position (bottom, BYTE_BUF_BEGV (buf), wrap_buffer (buf));
+ set_marker_byte_position (top, BYTE_BUF_ZV (buf), wrap_buffer (buf));
Fset_marker_insertion_type (top, Qt);
return noseeum_cons (wrap_buffer (buf), noseeum_cons (bottom, top));
@@ -2165,8 +2165,8 @@
/* someone could have killed the buffer in the meantime ... */
if (BUFFER_LIVE_P (buf))
{
- Bytebpos byte_start = byte_marker_position (XCAR (markers));
- Bytebpos byte_end = byte_marker_position (XCDR (markers));
+ Bytebpos byte_start = marker_byte_position (XCAR (markers));
+ Bytebpos byte_end = marker_byte_position (XCDR (markers));
Bytebpos clipped;
if (BYTE_BUF_BEGV (buf) != byte_start)
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/extents.h
--- a/src/extents.h Sun Mar 10 17:24:04 2019 +0000
+++ b/src/extents.h Sun Mar 10 18:02:36 2019 +0000
@@ -221,7 +221,7 @@
case lrecord_type_buffer:
return BYTE_BUF_PT (XBUFFER (stream));
case lrecord_type_marker:
- return byte_marker_position (stream);
+ return marker_byte_position (stream);
}
}
return -1;
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/fileio.c
--- a/src/fileio.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/fileio.c Sun Mar 10 18:02:36 2019 +0000
@@ -193,7 +193,7 @@
static Lisp_Object
restore_point_unwind (Lisp_Object point_marker)
{
- BYTE_BUF_SET_PT (current_buffer, byte_marker_position (point_marker));
+ BYTE_BUF_SET_PT (current_buffer, marker_byte_position (point_marker));
return Fset_marker (point_marker, Qnil, Qnil);
}
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/line-number.c
--- a/src/line-number.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/line-number.c Sun Mar 10 18:02:36 2019 +0000
@@ -134,7 +134,7 @@
at point, which is way losing. Isn't there a way to make a
marker impervious to Finsert_before_markers()?? Maybe I
should convert the code to use extents. */
- if (byte_marker_position (XCAR (ring[i])) >= pos)
+ if (marker_byte_position (XCAR (ring[i])) >= pos)
{
/* Get the marker out of the way. */
Fset_marker (XCAR (ring[i]), Qnil, Qnil);
@@ -216,7 +216,7 @@
/* Find the ring entry closest to POS, if it is closer than BEG. */
for (i = 0; i < LINE_NUMBER_RING_SIZE && CONSP (ring[i]); i++)
{
- Bytebpos newpos = byte_marker_position (XCAR (ring[i]));
+ Bytebpos newpos = marker_byte_position (XCAR (ring[i]));
Bytecount howfar = newpos - pos;
if (howfar < 0)
howfar = -howfar;
@@ -245,7 +245,7 @@
ring[i] = ring[i - 1];
/* ...and update it. */
- ring[0] = Fcons (set_byte_marker_position (Fmake_marker (), pos,
+ ring[0] = Fcons (set_marker_byte_position (Fmake_marker (), pos,
wrap_buffer (b)),
make_fixnum (line));
}
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/lisp.h
--- a/src/lisp.h Sun Mar 10 17:24:04 2019 +0000
+++ b/src/lisp.h Sun Mar 10 18:02:36 2019 +0000
@@ -5702,8 +5702,8 @@
EXFUN (Fset_marker, 3);
EXFUN (Fset_marker_insertion_type, 2);
-Bytebpos byte_marker_position (Lisp_Object);
Charbpos marker_position (Lisp_Object);
+Bytebpos marker_byte_position (Lisp_Object);
/* Set the byte position of MARKER, a marker object, to BYTENO in
BUFFER. MARKER must be a marker object, BUFFER must be a valid buffer, and
@@ -5711,7 +5711,7 @@
BUFFER's point marker. Values for MARKER, BYTENO, and BUFFER are checked
only if ERROR_CHECK_STRUCTURES is defined, and cause an assertion failure
if out of range, so callers need to check values themselves. */
-Lisp_Object set_byte_marker_position (Lisp_Object marker, Bytebpos byteno,
+Lisp_Object set_marker_byte_position (Lisp_Object marker, Bytebpos byteno,
Lisp_Object buffer);
/* No set_marker_position (); use Fset_marker (). */
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/lread.c
--- a/src/lread.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/lread.c Sun Mar 10 18:02:36 2019 +0000
@@ -264,14 +264,14 @@
else if (MARKERP (readcharfun))
{
Ichar c;
- Bytebpos mpos = byte_marker_position (readcharfun);
+ Bytebpos mpos = marker_byte_position (readcharfun);
struct buffer *inbuffer = XMARKER (readcharfun)->buffer;
if (mpos >= BYTE_BUF_ZV (inbuffer))
return -1;
c = BYTE_BUF_FETCH_CHAR (inbuffer, mpos);
INC_BYTEBPOS (inbuffer, mpos);
- set_byte_marker_position (readcharfun, mpos, wrap_buffer (inbuffer));
+ set_marker_byte_position (readcharfun, mpos, wrap_buffer (inbuffer));
return c;
}
else
@@ -311,12 +311,12 @@
}
else if (MARKERP (readcharfun))
{
- Bytebpos mpos = byte_marker_position (readcharfun);
+ Bytebpos mpos = marker_byte_position (readcharfun);
struct buffer *buf = XMARKER (readcharfun)->buffer;
DEC_BYTEBPOS (buf, mpos);
- set_byte_marker_position (readcharfun,
+ set_marker_byte_position (readcharfun,
/* This is extra-conservative, no code
actually unreads without having read
anything. */
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/lstream.c
--- a/src/lstream.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/lstream.c Sun Mar 10 18:02:36 2019 +0000
@@ -2067,8 +2067,8 @@
if (!BUFFER_LIVE_P (buf))
return 0; /* Fut. */
- start = byte_marker_position (str->start);
- end = byte_marker_position (str->end);
+ start = marker_byte_position (str->start);
+ end = marker_byte_position (str->end);
if (!(stream->flags & LSTR_IGNORE_ACCESSIBLE))
{
start = bytebpos_clip_to_bounds (BYTE_BUF_BEGV (buf), start,
@@ -2090,7 +2090,7 @@
*p = '\n';
}
- set_byte_marker_position (str->start, end, wrap_buffer (buf));
+ set_marker_byte_position (str->start, end, wrap_buffer (buf));
return size;
}
@@ -2138,16 +2138,16 @@
struct lisp_buffer_stream *str =
LISP_BUFFER_STREAM_DATA (stream);
struct buffer *buf = XBUFFER (str->buffer);
- Bytebpos pos = byte_marker_position (str->orig_start);
+ Bytebpos pos = marker_byte_position (str->orig_start);
if (!BUFFER_LIVE_P (buf))
return -1; /* Fut. */
if (pos > BYTE_BUF_ZV (buf))
pos = BYTE_BUF_ZV (buf);
- if (pos < byte_marker_position (str->orig_start))
- pos = byte_marker_position (str->orig_start);
- if (MARKERP (str->end) && pos > byte_marker_position (str->end))
- pos = byte_marker_position (str->end);
- set_byte_marker_position (str->start, pos, wrap_buffer (buf));
+ if (pos < marker_byte_position (str->orig_start))
+ pos = marker_byte_position (str->orig_start);
+ if (MARKERP (str->end) && pos > marker_byte_position (str->end))
+ pos = marker_byte_position (str->end);
+ set_marker_byte_position (str->start, pos, wrap_buffer (buf));
return 0;
}
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/marker.c
--- a/src/marker.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/marker.c Sun Mar 10 18:02:36 2019 +0000
@@ -355,7 +355,7 @@
BYTENO must be a valid byte position within BUFFER. MARKER may not be
BUFFER's point marker. */
Lisp_Object
-set_byte_marker_position (Lisp_Object marker, Bytebpos byteno,
+set_marker_byte_position (Lisp_Object marker, Bytebpos byteno,
Lisp_Object buffer)
{
#ifdef ERROR_CHECK_STRUCTURES
@@ -447,8 +447,19 @@
marker->buffer = 0;
}
+Charbpos
+marker_position (Lisp_Object marker)
+{
+ struct buffer *buf = XMARKER (marker)->buffer;
+
+ if (!buf)
+ invalid_argument ("Marker does not point anywhere", Qunbound);
+
+ return bytebpos_to_charbpos (buf, marker_byte_position (marker));
+}
+
Bytebpos
-byte_marker_position (Lisp_Object marker)
+marker_byte_position (Lisp_Object marker)
{
Lisp_Marker *m = XMARKER (marker);
struct buffer *buf = m->buffer;
@@ -468,17 +479,6 @@
return pos;
}
-Charbpos
-marker_position (Lisp_Object marker)
-{
- struct buffer *buf = XMARKER (marker)->buffer;
-
- if (!buf)
- invalid_argument ("Marker does not point anywhere", Qunbound);
-
- return bytebpos_to_charbpos (buf, byte_marker_position (marker));
-}
-
static Lisp_Object
copy_marker_1 (Lisp_Object marker, Lisp_Object type, int noseeum)
{
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/print.c
--- a/src/print.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/print.c Sun Mar 10 18:02:36 2019 +0000
@@ -490,8 +490,8 @@
doesn't point anywhere. */
marker_position (function), nonreloc, reloc,
offset, len, -1, 0);
- set_byte_marker_position (function,
- byte_marker_position (function) + len,
+ set_marker_byte_position (function,
+ marker_byte_position (function) + len,
wrap_buffer (XMARKER (function)->buffer));
UNGCPRO;
return len; /* We will have errored on failure. */
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/redisplay-output.c
--- a/src/redisplay-output.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/redisplay-output.c Sun Mar 10 18:02:36 2019 +0000
@@ -1028,7 +1028,7 @@
{
w->last_point_x[CURRENT_DISP] = 0;
w->last_point_y[CURRENT_DISP] = y;
- set_byte_marker_position (w->last_point[CURRENT_DISP],
+ set_marker_byte_position (w->last_point[CURRENT_DISP],
BYTE_BUF_BEG (w->buffer), w->buffer);
rb = Dynarr_begin (db->runes);
rb->cursor_type = CURSOR_ON;
@@ -2315,11 +2315,11 @@
w->last_modified[CURRENT_DISP] = w->last_modified[DESIRED_DISP];
w->last_facechange[CURRENT_DISP] = w->last_facechange[DESIRED_DISP];
- set_byte_marker_position (w->last_point[CURRENT_DISP],
- byte_marker_position (w->last_point[DESIRED_DISP]),
+ set_marker_byte_position (w->last_point[CURRENT_DISP],
+ marker_byte_position (w->last_point[DESIRED_DISP]),
w->buffer);
- set_byte_marker_position (w->last_start[CURRENT_DISP],
- byte_marker_position (w->last_start[DESIRED_DISP]),
+ set_marker_byte_position (w->last_start[CURRENT_DISP],
+ marker_byte_position (w->last_start[DESIRED_DISP]),
w->buffer);
/* We don't bother updating the vertical scrollbars here. This
@@ -2491,19 +2491,19 @@
}
w->window_end_pos[CURRENT_DISP] = w->window_end_pos[DESIRED_DISP];
- set_byte_marker_position (w->start[CURRENT_DISP],
- byte_marker_position (w->start[DESIRED_DISP]),
+ set_marker_byte_position (w->start[CURRENT_DISP],
+ marker_byte_position (w->start[DESIRED_DISP]),
w->buffer);
- set_byte_marker_position (w->pointm[CURRENT_DISP],
- byte_marker_position (w->pointm[DESIRED_DISP]),
+ set_marker_byte_position (w->pointm[CURRENT_DISP],
+ marker_byte_position (w->pointm[DESIRED_DISP]),
w->buffer);
w->last_modified[CURRENT_DISP] = w->last_modified[DESIRED_DISP];
w->last_facechange[CURRENT_DISP] = w->last_facechange[DESIRED_DISP];
- set_byte_marker_position (w->last_start[CURRENT_DISP],
- byte_marker_position (w->last_start[DESIRED_DISP]),
+ set_marker_byte_position (w->last_start[CURRENT_DISP],
+ marker_byte_position (w->last_start[DESIRED_DISP]),
w->buffer);
- set_byte_marker_position (w->last_point[CURRENT_DISP],
- byte_marker_position (w->last_point[DESIRED_DISP]),
+ set_marker_byte_position (w->last_point[CURRENT_DISP],
+ marker_byte_position (w->last_point[DESIRED_DISP]),
w->buffer);
w->last_point_x[CURRENT_DISP] = w->last_point_x[DESIRED_DISP];
w->last_point_y[CURRENT_DISP] = w->last_point_y[DESIRED_DISP];
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/redisplay.c
--- a/src/redisplay.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/redisplay.c Sun Mar 10 18:02:36 2019 +0000
@@ -959,7 +959,7 @@
if (MARKERP (Voverlay_arrow_position)
&& EQ (w->buffer, Fmarker_buffer (Voverlay_arrow_position))
- && byte_start_pos == byte_marker_position (Voverlay_arrow_position)
+ && byte_start_pos == marker_byte_position (Voverlay_arrow_position)
&& (STRINGP (Voverlay_arrow_string)
|| GLYPHP (Voverlay_arrow_string)))
{
@@ -2257,7 +2257,7 @@
}
else if (w == XWINDOW (FRAME_SELECTED_WINDOW (f)))
{
- data.byte_cursor_charpos = byte_marker_position (w->pointm[type]);
+ data.byte_cursor_charpos = marker_byte_position (w->pointm[type]);
data.cursor_type = CURSOR_ON;
}
else
@@ -5814,7 +5814,7 @@
/* If the cursor is moved we attempt to update it. If we succeed we
go ahead and proceed with the optimization attempt. */
if (!EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer)
- || byte_pointm != byte_marker_position (w->last_point[CURRENT_DISP]))
+ || byte_pointm != marker_byte_position (w->last_point[CURRENT_DISP]))
{
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
@@ -5876,7 +5876,7 @@
if (line > dla_end)
{
if (EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer)
- && byte_pointm == byte_marker_position (w->last_point[CURRENT_DISP]))
+ && byte_pointm == marker_byte_position (w->last_point[CURRENT_DISP]))
return 1;
else
return 0;
@@ -5892,7 +5892,7 @@
w->last_modified[DESIRED_DISP] = make_fixnum (BUF_MODIFF (b));
w->last_facechange[DESIRED_DISP] = make_fixnum (BUF_FACECHANGE (b));
Fset_marker (w->last_start[DESIRED_DISP], make_fixnum (startp), w->buffer);
- set_byte_marker_position (w->last_point[DESIRED_DISP],
+ set_marker_byte_position (w->last_point[DESIRED_DISP],
min (BYTE_BUF_Z (XBUFFER (w->buffer)),
max (BYTE_BUF_BEG (XBUFFER (w->buffer)),
byte_pointm)), w->buffer);
@@ -6359,7 +6359,7 @@
old_pointm = noseeum_copy_marker (selected_globally ? b->point_marker
: w->pointm[CURRENT_DISP], Qnil);
pointm = BUF_BEG (b);
- set_byte_marker_position (w->pointm[DESIRED_DISP], BYTE_BUF_BEG (b),
+ set_marker_byte_position (w->pointm[DESIRED_DISP], BYTE_BUF_BEG (b),
wrap_buffer (b));
}
else
@@ -6367,20 +6367,20 @@
if (selected_globally)
{
pointm = BUF_PT (b);
- set_byte_marker_position (w->pointm[DESIRED_DISP], BYTE_BUF_PT (b),
+ set_marker_byte_position (w->pointm[DESIRED_DISP], BYTE_BUF_PT (b),
the_buffer);
}
else
{
Bytebpos byte_pointm
- = byte_marker_position (w->pointm[CURRENT_DISP]);
+ = marker_byte_position (w->pointm[CURRENT_DISP]);
if (byte_pointm < BYTE_BUF_BEGV (b))
byte_pointm = BYTE_BUF_BEGV (b);
else if (byte_pointm > BYTE_BUF_ZV (b))
byte_pointm = BYTE_BUF_ZV (b);
- set_byte_marker_position (w->pointm[DESIRED_DISP], byte_pointm,
+ set_marker_byte_position (w->pointm[DESIRED_DISP], byte_pointm,
the_buffer);
pointm = bytebpos_to_charbpos (b, byte_pointm);
}
@@ -6432,12 +6432,12 @@
old_startp = noseeum_copy_marker (w->start[CURRENT_DISP], Qnil);
startp = BUF_BEG (b);
- set_byte_marker_position (w->start[DESIRED_DISP], BYTE_BUF_BEG (b),
+ set_marker_byte_position (w->start[DESIRED_DISP], BYTE_BUF_BEG (b),
the_buffer);
}
else
{
- Bytebpos byte_startp = byte_marker_position (w->start[CURRENT_DISP]);
+ Bytebpos byte_startp = marker_byte_position (w->start[CURRENT_DISP]);
if (byte_startp < BYTE_BUF_BEGV (b))
{
byte_startp = BYTE_BUF_BEGV (b);
@@ -6453,7 +6453,7 @@
startp = bytebpos_to_charbpos (b, byte_startp);
}
- set_byte_marker_position (w->start[DESIRED_DISP], byte_startp,
+ set_marker_byte_position (w->start[DESIRED_DISP], byte_startp,
the_buffer);
}
@@ -6503,7 +6503,7 @@
&& !truncation_changed
/* check whether start is really at the beginning of a line GE */
&& (!w->start_at_line_beg ||
- byte_beginning_of_line_p (b, byte_marker_position
+ byte_beginning_of_line_p (b, marker_byte_position
(w->start[DESIRED_DISP])))
)
{
@@ -6581,11 +6581,11 @@
up with a blank window. */
else if (((w->start_at_line_beg || MINI_WINDOW_P (w))
&& !(byte_beginning_of_line_p
- (b, byte_marker_position (w->start[DESIRED_DISP]))))
+ (b, marker_byte_position (w->start[DESIRED_DISP]))))
|| (pointm == startp &&
EQ (Fmarker_buffer (w->last_start[CURRENT_DISP]), w->buffer) &&
- byte_marker_position (w->start[DESIRED_DISP])
- < byte_marker_position (w->last_start[CURRENT_DISP]))
+ marker_byte_position (w->start[DESIRED_DISP])
+ < marker_byte_position (w->last_start[CURRENT_DISP]))
|| (startp == BUF_ZV (b)))
{
startp = regenerate_window_point_center (w, pointm, DESIRED_DISP);
@@ -7384,7 +7384,7 @@
{
Bytebpos pt = (w == XWINDOW (Fselected_window (Qnil)))
? BYTE_BUF_PT (b)
- : byte_marker_position (w->pointm[type]);
+ : marker_byte_position (w->pointm[type]);
Charcount col
= column_at_point (b, pt, 1) + !!column_number_start_at_one;
Ibyte buf[DECIMAL_PRINT_SIZE (col)];
@@ -7412,7 +7412,7 @@
case 'l':
{
Bytebpos pos = (w == XWINDOW (Fselected_window (Qnil)))
- ? BYTE_BUF_PT (b) : byte_marker_position (w->pointm[type]);
+ ? BYTE_BUF_PT (b) : marker_byte_position (w->pointm[type]);
Charcount line = buffer_line_number (b, pos, 1, 1) + 1;
Ibyte buf[DECIMAL_PRINT_SIZE (line)];
@@ -7509,7 +7509,7 @@
/* print percent of buffer above top of window, or Top, Bot or All */
case 'p':
{
- Bytebpos pos = byte_marker_position (w->start[type]);
+ Bytebpos pos = marker_byte_position (w->start[type]);
/* This had better be while the desired lines are being done. */
if (w->window_end_pos[type] <= BUF_Z (b) - BUF_ZV (b))
@@ -7554,7 +7554,7 @@
if (botpos >= BUF_ZV (b))
{
- if (byte_marker_position (w->start[type]) <= BYTE_BUF_BEGV (b))
+ if (marker_byte_position (w->start[type]) <= BYTE_BUF_BEGV (b))
str = "All";
else
str = "Bottom";
@@ -7562,7 +7562,7 @@
else
{
EMACS_UINT bytes, total = BYTE_BUF_ZV (b) - BYTE_BUF_BEGV (b);
- Bytebpos toppos = byte_marker_position (w->start[type]);
+ Bytebpos toppos = marker_byte_position (w->start[type]);
int percent;
Ibyte buf[DECIMAL_PRINT_SIZE (percent)];
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/syntax.c
--- a/src/syntax.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/syntax.c Sun Mar 10 18:02:36 2019 +0000
@@ -605,8 +605,8 @@
struct syntax_cache *cache = XBUFFER (object)->syntax_cache;
Bytexpos extent_start = extent_endpoint_byte (extent, 0);
Bytexpos extent_end = extent_endpoint_byte (extent, 1);
- Bytexpos cache_start = byte_marker_position (cache->start);
- Bytexpos cache_end = byte_marker_position (cache->end);
+ Bytexpos cache_start = marker_byte_position (cache->start);
+ Bytexpos cache_end = marker_byte_position (cache->end);
/* If the extent is entirely before or entirely after the cache
range, it doesn't overlap. Otherwise, invalidate the range. */
if (!(extent_end < cache_start || extent_start > cache_end))
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/text.c
--- a/src/text.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/text.c Sun Mar 10 18:02:36 2019 +0000
@@ -4252,7 +4252,7 @@
Bytebpos ind;
Bytebpos min_allowed, max_allowed;
- ind = byte_marker_position (pos);
+ ind = marker_byte_position (pos);
min_allowed
= flags & GB_ALLOW_PAST_ACCESSIBLE ? BYTE_BUF_BEG (b)
: BYTE_BUF_BEGV (b);
diff -r 5d1f8a39a8d0 -r 9061f6baa930 src/window.c
--- a/src/window.c Sun Mar 10 17:24:04 2019 +0000
+++ b/src/window.c Sun Mar 10 18:02:36 2019 +0000
@@ -2000,7 +2000,7 @@
/* WTF is the above supposed to mean? GE */
w->start_at_line_beg
= byte_beginning_of_line_p (XBUFFER (w->buffer),
- byte_marker_position (w->start[CURRENT_DISP]));
+ marker_byte_position (w->start[CURRENT_DISP]));
if (NILP (noforce))
w->force_start = 1;
w->redo_modeline = 1;
@@ -2082,8 +2082,8 @@
else
{
set_extent_endpoints (XEXTENT (saved_point),
- byte_marker_position (w->pointm[CURRENT_DISP]),
- byte_marker_position (w->pointm[CURRENT_DISP]),
+ marker_byte_position (w->pointm[CURRENT_DISP]),
+ marker_byte_position (w->pointm[CURRENT_DISP]),
buf);
}
@@ -2099,8 +2099,8 @@
}
set_extent_endpoints (XEXTENT (saved_window_start),
- byte_marker_position (w->start[CURRENT_DISP]),
- byte_marker_position (w->start[CURRENT_DISP]),
+ marker_byte_position (w->start[CURRENT_DISP]),
+ marker_byte_position (w->start[CURRENT_DISP]),
buf);
/* last_window_start records the start position that this buffer
@@ -3359,7 +3359,7 @@
w->buffer);
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
}
/* We need to do this, so that the window-scroll-functions
get called. */
@@ -3815,7 +3815,7 @@
since it always occurred when the window was selected, meaning its value
of point was ignored in favor of the buffer's; but it tripped an assert()
in unshow_buffer(). */
- set_byte_marker_position (w->pointm[CURRENT_DISP], bpoint, buffer);
+ set_marker_byte_position (w->pointm[CURRENT_DISP], bpoint, buffer);
if (EQ (wrap_window (w), Fselected_window (Qnil)))
{
BYTE_BUF_SET_PT (XBUFFER (buffer), bpoint);
@@ -3845,8 +3845,8 @@
bstart = BYTE_BUF_BEGV (XBUFFER (buffer));
}
- set_byte_marker_position (w->start[CURRENT_DISP], bstart, buffer);
- set_byte_marker_position (w->sb_point, bstart, buffer);
+ set_marker_byte_position (w->start[CURRENT_DISP], bstart, buffer);
+ set_marker_byte_position (w->sb_point, bstart, buffer);
/* set start_at_line_beg correctly. GE */
w->start_at_line_beg = byte_beginning_of_line_p (XBUFFER (buffer), bstart);
@@ -4690,7 +4690,7 @@
Fset_marker (w->start[CURRENT_DISP], point, w->buffer);
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
WINDOW_TEXT_TOP_CLIP (w) = 0;
MARK_WINDOWS_CHANGED (w);
}
@@ -4792,7 +4792,7 @@
w->force_start = 1;
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
MARK_WINDOWS_CHANGED (w);
if (!point_would_be_visible (w, startp, XFIXNUM (point), 0))
@@ -4844,7 +4844,7 @@
w->force_start = 1;
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
MARK_WINDOWS_CHANGED (w);
/* #### Scroll back by less than a line. This code was
@@ -4909,7 +4909,7 @@
w->force_start = 1;
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
MARK_WINDOWS_CHANGED (w);
if (!point_would_be_visible (w, startp, XFIXNUM (point), 0))
@@ -5089,7 +5089,7 @@
w->start_at_line_beg
= byte_beginning_of_line_p (b,
- byte_marker_position (w->start[CURRENT_DISP]));
+ marker_byte_position (w->start[CURRENT_DISP]));
w->force_start = 1;
MARK_WINDOWS_CHANGED (w);
return Qnil;
@@ -5195,7 +5195,7 @@
w->buffer);
w->start_at_line_beg
= byte_beginning_of_line_p
- (b, byte_marker_position (w->start[CURRENT_DISP]));
+ (b, marker_byte_position (w->start[CURRENT_DISP]));
w->force_start = 1;
}
else
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)