aboutsummaryrefslogtreecommitdiffstats
path: root/src/intervals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intervals.c b/src/intervals.c
index f2ddcd01507..ded536ca3c8 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1821,6 +1821,18 @@ set_point (ptrdiff_t charpos)
1821 set_point_both (charpos, buf_charpos_to_bytepos (current_buffer, charpos)); 1821 set_point_both (charpos, buf_charpos_to_bytepos (current_buffer, charpos));
1822} 1822}
1823 1823
1824/* Set PT from MARKER's clipped position. */
1825
1826void
1827set_point_from_marker (Lisp_Object marker)
1828{
1829 if (XMARKER (marker)->buffer != current_buffer)
1830 signal_error ("Marker points into wrong buffer", marker);
1831 set_point_both
1832 (clip_to_bounds (BEGV, marker_position (marker), ZV),
1833 clip_to_bounds (BEGV_BYTE, marker_byte_position (marker), ZV_BYTE));
1834}
1835
1824/* If there's an invisible character at position POS + TEST_OFFS in the 1836/* If there's an invisible character at position POS + TEST_OFFS in the
1825 current buffer, and the invisible property has a `stickiness' such that 1837 current buffer, and the invisible property has a `stickiness' such that
1826 inserting a character at position POS would inherit the property it, 1838 inserting a character at position POS would inherit the property it,