diff options
| author | Dmitry Antipov | 2013-08-29 20:36:54 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-29 20:36:54 +0400 |
| commit | 032f74518a71a7fe0afd2e7d0eee11bfb7ae90d9 (patch) | |
| tree | cec342cb647d9242855b8f0d4b5a9783d8851176 /src/editfns.c | |
| parent | 3f940c5aa6fc1d03e6658cda5c440fb6bd75e4c5 (diff) | |
| download | emacs-032f74518a71a7fe0afd2e7d0eee11bfb7ae90d9.tar.gz emacs-032f74518a71a7fe0afd2e7d0eee11bfb7ae90d9.zip | |
* intervals.c (set_point_from_marker): New function.
* editfns.c (Fgoto_char):
* process.c (Finternal_default_process_filter):
* window.c (select_window_1): Use it.
* buffer.h (set_point_from_marker): Add prototype.
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 | ||