>>>> "Yoshiki" == Yoshiki Hayashi
<t90553(a)m.ecc.u-tokyo.ac.jp> writes:
Yoshiki> "Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> writes:
> Coordination of the literal transcript buffer and the
> presentation buffer would be tricky; I think I know how to go
> from literal -> presentation but I don't know whather that
> would be invertible.
Yoshiki> As you have written, data that looks like two escape
Yoshiki> sequences in a row will get lost. Some data might be
Yoshiki> lost or some garbage will be added if eol conversion is
Yoshiki> CRLF or CR since newline is normalized to LF internally.
Actually, that's the point; the presentation buffer will be changed,
and data lost in the presentation buffer, but _not in the underlying
buffer_ because that _always_ contains the raw text as I design it.[1]
(It might not be possible to do this with indirect buffers, I don't
really understand those yet.)
Ben has proposed a way to do this efficiently for large buffers, but
for shell modes I think it's probably reasonable to keep two buffers.
The only time this would not be true is if the user made changes that
involved deleting and _manually_ restoring the text around the double
escape sequence, because `insert' won't know there used to be an
escape sequence governing a null extent in the literal buffer.
You're right that in the case where the user inserts a linebreak in
the first line of text using one convention and the preceding text
uses a different convention, we can't get it right. But I don't think
we really care, do we?
In fact, if the user is editing the shell buffer as text, the newline
convention used for insertions doesn't matter, the escape sequences
inserted are not part of the text stream as such. If the user cares
about those things, they have to edit the stream in binary mode.
What we want to do is make sure that parts that the user has not
changed remain as the external process output them.
Or are you thinking that we also need to guess what form of input the
external process is expecting? In almost all cases, that should be
known already, and fixed for the life of the process, shouldn't it?
Footnotes:
[1] Actually, this is my conception of a proposal made in skeleton
form by Ben. Good parts are his, errors are mine; the obvious we can
share. ;-)
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
_________________ _________________ _________________ _________________
What are those straight lines for? "XEmacs rules."