Commit 6b312f0f authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* marker.c (set_marker_restricted_both): Simplify by using

clip_to_bounds.
parent f520ef9b
2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.
2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
* editfns.c (region_limit): Simplify by using clip_to_bounds.
......
......@@ -667,14 +667,8 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, ptrdiff_t ch
}
}
if (charpos < BUF_BEGV (b))
charpos = BUF_BEGV (b);
if (charpos > BUF_ZV (b))
charpos = BUF_ZV (b);
if (bytepos < BUF_BEGV_BYTE (b))
bytepos = BUF_BEGV_BYTE (b);
if (bytepos > BUF_ZV_BYTE (b))
bytepos = BUF_ZV_BYTE (b);
charpos = clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b));
bytepos = clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b));
/* In a single-byte buffer, the two positions must be equal. */
if (BUF_Z (b) == BUF_Z_BYTE (b)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment