>>>> "Andy" == Andy Piper
<andy(a)xemacs.org> writes:
Andy> I still think we are actually missing a function, something
Andy> like `refresh-buffer', since revert-buffer is too
Andy> fierce.
How about `sync-buffer' for the name? "Refresh" implies display
properties to me, ie, redoing all the expensive operations (fontlock,
semantic parsing) for the whole buffer. Exactly what you don't want.
For implementation, try something rsync-like and only revert those
regions of the buffer with actual changes. Since AFAIK font-lock is
line-oriented, a diff with a temporary file (buffer image) and a merge
in Lisp should be satisfactory. Since the diff is used immediately,
no context is needed, this should be only a few lines of Lisp to parse
and execute a non-context-diff patch. It would probably make sense to
look at font-lock with a view to optimizing line-oriented changes.
But now you've got several file i/o operations to worry about. And
this function might be called on non-text buffers, where diff may do
crazy things. Getting this right would be tricky.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Don't ask how you can "do" free software business;
ask what your business can "do for" free software.