diff options
| author | Stefan Monnier | 2019-05-07 13:41:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-07 13:41:54 -0400 |
| commit | 32cf07819ae8cfdbf14e00f351c7f520fff325c3 (patch) | |
| tree | 029f5e0b51aa8052bba25d79bb9fba9fb42ecee6 /src/buffer.h | |
| parent | 81d83cf6357c73ac5e8de8aeac9760ab00f5af0a (diff) | |
| download | emacs-32cf07819ae8cfdbf14e00f351c7f520fff325c3.tar.gz emacs-32cf07819ae8cfdbf14e00f351c7f520fff325c3.zip | |
* src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion
This assertion was removed in 1c349c62305d432abf0fa2b6e3f5d754fe4cab79
because the assumption was invalid during set_intervals_multibyte_1.
So we change set_intervals_multibyte_1 to solve the problem in the same
way as in the rest of Fset_buffer_multibyte, which actually simplifies
the code.
* src/buffer.c (advance_to_char_boundary): Not static any more.
* src/buffer.h (advance_to_char_boundary): Add prototype.
* src/intervals.c (set_intervals_multibyte_1): Use it.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index f42c3e97b97..2080a6f40b7 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -327,6 +327,10 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t); | |||
| 327 | #define BYTE_TO_CHAR(bytepos) \ | 327 | #define BYTE_TO_CHAR(bytepos) \ |
| 328 | (buf_bytepos_to_charpos (current_buffer, bytepos)) | 328 | (buf_bytepos_to_charpos (current_buffer, bytepos)) |
| 329 | 329 | ||
| 330 | /* For those very rare cases where you may have a "random" pointer into | ||
| 331 | the middle of a multibyte char, this moves to the next boundary. */ | ||
| 332 | extern ptrdiff_t advance_to_char_boundary (ptrdiff_t byte_pos); | ||
| 333 | |||
| 330 | /* Convert PTR, the address of a byte in the buffer, into a byte position. */ | 334 | /* Convert PTR, the address of a byte in the buffer, into a byte position. */ |
| 331 | 335 | ||
| 332 | #define PTR_BYTE_POS(ptr) \ | 336 | #define PTR_BYTE_POS(ptr) \ |