Ar an fichiú lá de mí na Nollaig, scríobh Stephen J. Turnbull:
Aidan Kehoe writes:
> Markers and extents are always at character boundaries, they never point to
> the middle of an Ichar’s Ibyte representation.
Of course not. They can however point into the middle of what will be
a character when using `decode-coding-region' in a buffer read as 'binary.
Mmm, not currently, since #'decode-coding-region is implemented as deletion
followed by insertion, and the markers (and extent endpoints) are updated
with each operation. But I understand what you mean.
> If you mean rather that they overlap the boundaries of the
region to be
> changed, preserving them when encoding or decoding needs to be handled
> within insdel.c. It is within that file, especially within
> buffer_delete_range(), that the decision to delete any extents and to adjust
> any markers is made.
Sure, but ISTM part of the problem with `decode-coding-region' is that
the information about positions simply isn't available to insdel functions.
If it were just a matter of that, a call to bytecount_to_charcount() would
address it.
Ben suggests in some discussion on this that the relevant marker- and
extent-positions be determined, the input be split up into segments
appropriately, and the coding systems called on those segments individually.
That seems to me to be the most thorough and correct approach to take.
> > What still needs to be done?
>
> As it is, it aborts if you turn on ERROR_CHECK_TEXT, character_tell()
> gives the wrong answer if the stream is rewound, it’s not implemented
> for a lot of coding systems where its implementation would be trivial
OK. Don't know how much time I'll have available, but this kind of
thing is something I want to look into over winter break.
Am stuck at the airport for today, but I have some large paying translation
projects to keep me occupied. I may get to this patch again in my breaks.
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches