Commit f520ef9b authored by Paul Eggert's avatar Paul Eggert

* editfns.c (region_limit): Simplify by using clip_to_bounds.

parent 383b7c95
2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
* editfns.c (region_limit): Simplify by using clip_to_bounds.
2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
......
......@@ -281,13 +281,10 @@ region_limit (int beginningp)
if (NILP (m))
error ("The mark is not set now, so there is no region");
if ((PT < XFASTINT (m)) == (beginningp != 0))
return make_number (PT);
else
{ /* Clip to the current narrowing (bug#11770). */
ptrdiff_t mark = XFASTINT (m);
return make_number (mark < BEGV ? BEGV : mark > ZV ? ZV : mark);
}
/* Clip to the current narrowing (bug#11770). */
return make_number ((PT < XFASTINT (m)) == (beginningp != 0)
? PT
: clip_to_bounds (BEGV, XFASTINT (m), ZV));
}
DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0,
......
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