summaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-07-02 16:04:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-07-02 16:04:16 -0400
commitdc3093904d74a7c51d452439888c4f36e4274e9f (patch)
treeb829cf7425eaea8a39ffddb3e771626bdf5d9bf0 /src/json.c
parent1c88af362f038c010f1a5c63e0ed5a431ba5d5a7 (diff)
downloademacs-dc3093904d74a7c51d452439888c4f36e4274e9f.tar.gz
* src/insdel.c (insert_from_gap_1): New fun, extracted from insert_from_gap.
(insert_from_gap): Use it. * src/lisp.h (insert_from_gap_1): Declare it. * src/json.c (Fjson_insert): * src/fileio.c (Finsert_file_contents): Use it.
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/json.c b/src/json.c
index 4c897d4be04..607b8d32646 100644
--- a/src/json.c
+++ b/src/json.c
@@ -740,17 +740,7 @@ usage: (json-insert OBJECT &rest ARGS) */)
if (inserted_bytes > 0)
{
/* Make the inserted text part of the buffer, as unibyte text. */
- GAP_SIZE -= inserted_bytes;
- GPT += inserted_bytes;
- GPT_BYTE += inserted_bytes;
- ZV += inserted_bytes;
- ZV_BYTE += inserted_bytes;
- Z += inserted_bytes;
- Z_BYTE += inserted_bytes;
-
- if (GAP_SIZE > 0)
- /* Put an anchor to ensure multi-byte form ends at gap. */
- *GPT_ADDR = 0;
+ insert_from_gap_1 (inserted_bytes, inserted_bytes, false);
/* If required, decode the stuff we've read into the gap. */
struct coding_system coding;