[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where to put eol kludge

From: Thien-Thi Nguyen
Subject: Re: where to put eol kludge
Date: 16 May 2003 06:20:10 -0400

Kenichi Handa <address@hidden> writes:

   It's e_write, not emacs_write, that calls encode-coding.
   Anyway, I agree that emacs_write is the better place for
   such a job.

oops, my bad.

in any case, it seems to me the criteria for the best place for the
kludge would be where chunking of the write occurs, since the kludge has
the re-chunking nature.  which indicates `e_write' after all.  in other
words, something like:

  result = encode_coding (...);
  /* kludge to adjust end of write buffer by way of
     adjusting coding->produced goes here */
  if (coding->produced)

this way, emacs_write can remain dumb.  otherwise, to do the kludge at
emacs_write level requires extra information to be passed in, saying
whether or not "this is the last write" and information to be passed
out, saying "here are the leftover unwritten bytes which you can use in
the next call since this call was not the last write".

if this kludge had more general use, i might even suggest moving it into
encode_coding for efficiency (i.e., rather than throw away the tail of
the encoding after eol, add a flag to stop encoding at the "last" eol).
but on second thought probably determining last eol reliably would not
preclude processing post-last-eol anyway...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]