aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-05 20:14:39 +0400
committerDmitry Antipov2012-07-05 20:14:39 +0400
commit6b312f0fec9becd1ce97f55d5707e79586f954eb (patch)
treee8c4d97a3512b3efec0b3257435c56de3b66cd60 /src
parentf520ef9bc1f5d7b88b401c8784ac29457a0ef43c (diff)
downloademacs-6b312f0fec9becd1ce97f55d5707e79586f954eb.tar.gz
emacs-6b312f0fec9becd1ce97f55d5707e79586f954eb.zip
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/marker.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 97c3ca9547d..a2cfd3029f3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * marker.c (set_marker_restricted_both): Simplify by using
4 clip_to_bounds.
5
12012-07-05 Paul Eggert <eggert@cs.ucla.edu> 62012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * editfns.c (region_limit): Simplify by using clip_to_bounds. 8 * 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
667 } 667 }
668 } 668 }
669 669
670 if (charpos < BUF_BEGV (b)) 670 charpos = clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b));
671 charpos = BUF_BEGV (b); 671 bytepos = clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b));
672 if (charpos > BUF_ZV (b))
673 charpos = BUF_ZV (b);
674 if (bytepos < BUF_BEGV_BYTE (b))
675 bytepos = BUF_BEGV_BYTE (b);
676 if (bytepos > BUF_ZV_BYTE (b))
677 bytepos = BUF_ZV_BYTE (b);
678 672
679 /* In a single-byte buffer, the two positions must be equal. */ 673 /* In a single-byte buffer, the two positions must be equal. */
680 if (BUF_Z (b) == BUF_Z_BYTE (b) 674 if (BUF_Z (b) == BUF_Z_BYTE (b)