Ar an fichiú lá de mí na Nollaig, scríobh Stephen J. Turnbull:
viewmail-info deleted to avoid spamming myself.
Aidan Kehoe writes:
> The coding systems in general know exactly where the character
> boundaries are, though, and if they record it there’s no need for
> the buffer insertion code to do that work. The below patch gives
> noticeably snappier performance for me loading large files with
> reasonable amounts of non-ASCII characters.
Is it possible that this patch could be improved to help the insdel
code properly deal with markers and extents at character boundaries
during in-buffer conversions, rather than trashing them as it
currently does? Of course markers not at character boundary in the
decoding operation can't be accurately preserved, but some
approximation should be good enough.
Markers and extents are always at character boundaries, they never point to
the middle of an Ichar’s Ibyte representation.
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. There should be an analogous buffer_replace_range (). I
note that GNU have had a replace_range() since 1997, and while it wasn’t
obvious then that it was necessary, I think it is.
> It is very very much not ready to commit, I post it to show the
idea and
> because I don’t anticipate I’ll get to finishing it this month.
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
--
‘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