[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2bc90e0c: * src/coding.c (decode_coding): Improve d
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 2bc90e0c: * src/coding.c (decode_coding): Improve doc. |
Date: |
Thu, 4 Jul 2019 10:14:02 -0400 (EDT) |
branch: master
commit 2bc90e0ce0f349b8c80aa8df782f991b64aa7398
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* src/coding.c (decode_coding): Improve doc.
---
src/coding.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/coding.c b/src/coding.c
index 59589ca..e90d571 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7324,9 +7324,13 @@ produce_annotation (struct coding_system *coding,
ptrdiff_t pos)
In this case, if CODING->src_pos is positive, it is a position of
the source text in the buffer, otherwise, the source text is in the
gap area of the buffer, and CODING->src_pos specifies the offset of
- the text from GPT (which must be the same as PT). If this is the
- same buffer as CODING->dst_object, CODING->src_pos must be
- negative.
+ the text from the end of the gap (and GPT must be equal to PT).
+
+ When the text is taken from the gap, it can't be at the beginning
+ of the gap because the new decoded text is progressively acumulated
+ at the beginning of the gap before it gets inserted at PT (this way,
+ as the output grows, the input shrinks, so we only need to allocate
+ enough space for `max(IN, OUT)` instead of `IN + OUT`).
If CODING->src_object is a string, CODING->src_pos is an index to
that string.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 2bc90e0c: * src/coding.c (decode_coding): Improve doc.,
Stefan Monnier <=