diff options
| author | Stefan Monnier | 2019-07-02 15:48:25 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-07-02 15:48:25 -0400 |
| commit | 1c88af362f038c010f1a5c63e0ed5a431ba5d5a7 (patch) | |
| tree | 6761f545616f76037bde284f6ae20a3d27a801b6 /src/coding.c | |
| parent | a2c56a90f939e9becb7bb47328e72c58eff40b5e (diff) | |
| download | emacs-1c88af362f038c010f1a5c63e0ed5a431ba5d5a7.tar.gz emacs-1c88af362f038c010f1a5c63e0ed5a431ba5d5a7.zip | |
* 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) | |||
| 7892 | bset_undo_list (buf, undo_list); | 7892 | bset_undo_list (buf, undo_list); |
| 7893 | } | 7893 | } |
| 7894 | 7894 | ||
| 7895 | /* Decode the *last* BYTES of the gap and insert them at point. */ | ||
| 7895 | void | 7896 | void |
| 7896 | decode_coding_gap (struct coding_system *coding, | 7897 | decode_coding_gap (struct coding_system *coding, ptrdiff_t bytes) |
| 7897 | ptrdiff_t chars, ptrdiff_t bytes) | ||
| 7898 | { | 7898 | { |
| 7899 | ptrdiff_t count = SPECPDL_INDEX (); | 7899 | ptrdiff_t count = SPECPDL_INDEX (); |
| 7900 | Lisp_Object attrs; | 7900 | Lisp_Object attrs; |
| 7901 | 7901 | ||
| 7902 | eassert (GPT_BYTE == PT_BYTE); | ||
| 7903 | |||
| 7902 | coding->src_object = Fcurrent_buffer (); | 7904 | coding->src_object = Fcurrent_buffer (); |
| 7903 | coding->src_chars = chars; | 7905 | coding->src_chars = bytes; |
| 7904 | coding->src_bytes = bytes; | 7906 | coding->src_bytes = bytes; |
| 7905 | coding->src_pos = -chars; | 7907 | coding->src_pos = -bytes; |
| 7906 | coding->src_pos_byte = -bytes; | 7908 | coding->src_pos_byte = -bytes; |
| 7907 | coding->src_multibyte = chars < bytes; | 7909 | coding->src_multibyte = false; |
| 7908 | coding->dst_object = coding->src_object; | 7910 | coding->dst_object = coding->src_object; |
| 7909 | coding->dst_pos = PT; | 7911 | coding->dst_pos = PT; |
| 7910 | coding->dst_pos_byte = PT_BYTE; | 7912 | coding->dst_pos_byte = PT_BYTE; |
| 7911 | coding->dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 7913 | eassert (coding->dst_multibyte |
| 7914 | == !NILP (BVAR (current_buffer, enable_multibyte_characters))); | ||
| 7912 | 7915 | ||
| 7913 | coding->head_ascii = -1; | 7916 | coding->head_ascii = -1; |
| 7914 | coding->detected_utf8_bytes = coding->detected_utf8_chars = -1; | 7917 | coding->detected_utf8_bytes = coding->detected_utf8_chars = -1; |
| @@ -7922,7 +7925,7 @@ decode_coding_gap (struct coding_system *coding, | |||
| 7922 | && NILP (CODING_ATTR_POST_READ (attrs)) | 7925 | && NILP (CODING_ATTR_POST_READ (attrs)) |
| 7923 | && NILP (get_translation_table (attrs, 0, NULL))) | 7926 | && NILP (get_translation_table (attrs, 0, NULL))) |
| 7924 | { | 7927 | { |
| 7925 | chars = coding->head_ascii; | 7928 | ptrdiff_t chars = coding->head_ascii; |
| 7926 | if (chars < 0) | 7929 | if (chars < 0) |
| 7927 | chars = check_ascii (coding); | 7930 | chars = check_ascii (coding); |
| 7928 | if (chars != bytes) | 7931 | if (chars != bytes) |