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/intervals.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/intervals.c')
| -rw-r--r-- | src/intervals.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intervals.c b/src/intervals.c index f2ddcd01507..671b2a3d527 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1821,6 +1821,18 @@ set_point (ptrdiff_t charpos) | |||
| 1821 | set_point_both (charpos, buf_charpos_to_bytepos (current_buffer, charpos)); | 1821 | set_point_both (charpos, buf_charpos_to_bytepos (current_buffer, charpos)); |
| 1822 | } | 1822 | } |
| 1823 | 1823 | ||
| 1824 | /* Set PT from MARKER's clipped position. */ | ||
| 1825 | |||
| 1826 | void | ||
| 1827 | set_point_from_marker (Lisp_Object marker) | ||
| 1828 | { | ||
| 1829 | if (XMARKER (marker)->buffer != current_buffer) | ||
| 1830 | error ("Marker points into wrong buffer"); | ||
| 1831 | set_point_both | ||
| 1832 | (clip_to_bounds (BEGV, marker_position (marker), ZV), | ||
| 1833 | clip_to_bounds (BEGV_BYTE, marker_byte_position (marker), ZV_BYTE)); | ||
| 1834 | } | ||
| 1835 | |||
| 1824 | /* If there's an invisible character at position POS + TEST_OFFS in the | 1836 | /* If there's an invisible character at position POS + TEST_OFFS in the |
| 1825 | current buffer, and the invisible property has a `stickiness' such that | 1837 | current buffer, and the invisible property has a `stickiness' such that |
| 1826 | inserting a character at position POS would inherit the property it, | 1838 | inserting a character at position POS would inherit the property it, |