aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorStefan Monnier2019-05-07 13:41:54 -0400
committerStefan Monnier2019-05-07 13:41:54 -0400
commit32cf07819ae8cfdbf14e00f351c7f520fff325c3 (patch)
tree029f5e0b51aa8052bba25d79bb9fba9fb42ecee6 /src/buffer.c
parent81d83cf6357c73ac5e8de8aeac9760ab00f5af0a (diff)
downloademacs-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.c')
-rw-r--r--src/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ab477481912..3b5078a175b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2264,7 +2264,7 @@ validate_region (register Lisp_Object *b, register Lisp_Object *e)
2264/* Advance BYTE_POS up to a character boundary 2264/* Advance BYTE_POS up to a character boundary
2265 and return the adjusted position. */ 2265 and return the adjusted position. */
2266 2266
2267static ptrdiff_t 2267ptrdiff_t
2268advance_to_char_boundary (ptrdiff_t byte_pos) 2268advance_to_char_boundary (ptrdiff_t byte_pos)
2269{ 2269{
2270 int c; 2270 int c;
@@ -2702,6 +2702,9 @@ current buffer is cleared. */)
2702 2702
2703 /* Do this last, so it can calculate the new correspondences 2703 /* Do this last, so it can calculate the new correspondences
2704 between chars and bytes. */ 2704 between chars and bytes. */
2705 /* FIXME: Is it worth the trouble, really? Couldn't we just throw
2706 away all the text-properties instead of trying to guess how
2707 to adjust them? AFAICT the result is not reliable anyway. */
2705 set_intervals_multibyte (1); 2708 set_intervals_multibyte (1);
2706 } 2709 }
2707 2710