diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/editfns.c b/src/editfns.c index 9e36655f3d3..84a5c8395fc 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -233,26 +233,12 @@ Beginning of buffer is position (point-min), end is (point-max). | |||
| 233 | The return value is POSITION. */) | 233 | The return value is POSITION. */) |
| 234 | (register Lisp_Object position) | 234 | (register Lisp_Object position) |
| 235 | { | 235 | { |
| 236 | ptrdiff_t pos; | 236 | if (MARKERP (position)) |
| 237 | 237 | set_point_from_marker (position); | |
| 238 | if (MARKERP (position) | 238 | else if (INTEGERP (position)) |
| 239 | && current_buffer == XMARKER (position)->buffer) | 239 | SET_PT (clip_to_bounds (BEGV, XINT (position), ZV)); |
| 240 | { | 240 | else |
| 241 | pos = marker_position (position); | 241 | wrong_type_argument (Qinteger_or_marker_p, position); |
| 242 | if (pos < BEGV) | ||
| 243 | SET_PT_BOTH (BEGV, BEGV_BYTE); | ||
| 244 | else if (pos > ZV) | ||
| 245 | SET_PT_BOTH (ZV, ZV_BYTE); | ||
| 246 | else | ||
| 247 | SET_PT_BOTH (pos, marker_byte_position (position)); | ||
| 248 | |||
| 249 | return position; | ||
| 250 | } | ||
| 251 | |||
| 252 | CHECK_NUMBER_COERCE_MARKER (position); | ||
| 253 | |||
| 254 | pos = clip_to_bounds (BEGV, XINT (position), ZV); | ||
| 255 | SET_PT (pos); | ||
| 256 | return position; | 242 | return position; |
| 257 | } | 243 | } |
| 258 | 244 | ||