diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-07-02 15:48:25 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-07-02 15:48:25 -0400 |
| commit | 1c88af362f038c010f1a5c63e0ed5a431ba5d5a7 (patch) | |
| tree | 6761f545616f76037bde284f6ae20a3d27a801b6 /src/coding.c | |
| parent | a2c56a90f939e9becb7bb47328e72c58eff40b5e (diff) | |
| download | emacs-1c88af362f038c010f1a5c63e0ed5a431ba5d5a7.tar.gz | |
* src/coding.c (decode_coding_gap): Remove `chars` argument.
* src/json.c (Fjson_insert):
* src/fileio.c (Finsert_file_contents):
* src/coding.h (decode_coding_gap): Adjust accordingly.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/coding.c b/src/coding.c index 5b9bfa17dd2..59589caee61 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7892,23 +7892,26 @@ coding_restore_undo_list (Lisp_Object arg) bset_undo_list (buf, undo_list); } +/* Decode the *last* BYTES of the gap and insert them at point. */ void -decode_coding_gap (struct coding_system *coding, - ptrdiff_t chars, ptrdiff_t bytes) +decode_coding_gap (struct coding_system *coding, ptrdiff_t bytes) { ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object attrs; + eassert (GPT_BYTE == PT_BYTE); + coding->src_object = Fcurrent_buffer (); - coding->src_chars = chars; + coding->src_chars = bytes; coding->src_bytes = bytes; - coding->src_pos = -chars; + coding->src_pos = -bytes; coding->src_pos_byte = -bytes; - coding->src_multibyte = chars < bytes; + coding->src_multibyte = false; coding->dst_object = coding->src_object; coding->dst_pos = PT; coding->dst_pos_byte = PT_BYTE; - coding->dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + eassert (coding->dst_multibyte + == !NILP (BVAR (current_buffer, enable_multibyte_characters))); coding->head_ascii = -1; coding->detected_utf8_bytes = coding->detected_utf8_chars = -1; @@ -7922,7 +7925,7 @@ decode_coding_gap (struct coding_system *coding, && NILP (CODING_ATTR_POST_READ (attrs)) && NILP (get_translation_table (attrs, 0, NULL))) { - chars = coding->head_ascii; + ptrdiff_t chars = coding->head_ascii; if (chars < 0) chars = check_ascii (coding); if (chars != bytes) |
