From: Dmitry Antipov Date: Thu, 5 Jul 2012 16:14:39 +0000 (+0400) Subject: * marker.c (set_marker_restricted_both): Simplify by using X-Git-Tag: emacs-24.2.90~1199^2~204 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b312f0fec9becd1ce97f55d5707e79586f954eb;p=emacs.git * marker.c (set_marker_restricted_both): Simplify by using clip_to_bounds. --- diff --git a/src/ChangeLog b/src/ChangeLog index 97c3ca9547d..a2cfd3029f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-07-05 Dmitry Antipov + + * marker.c (set_marker_restricted_both): Simplify by using + clip_to_bounds. + 2012-07-05 Paul Eggert * editfns.c (region_limit): Simplify by using clip_to_bounds. diff --git a/src/marker.c b/src/marker.c index 2c09b8e19a2..a059987aa51 100644 --- a/src/marker.c +++ b/src/marker.c @@ -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)