Thanks. I will work on this.
andy
-----Original Message-----
From: xemacs-beta-admin(a)xemacs.org
[mailto:xemacs-beta-adminï¼ xemacs.org]On Behalf Of Ben Wing
Sent: Saturday, November 17, 2001 10:52 PM
To: Andy Piper
Cc: Andy Piper; Stephen J. Turnbull; Paul Krause; XEmacs Beta List
Subject: Re: [VETO] Revert buffer patch
replace the regular revert-buffer function with this:
1. remember the file size when you revert.
2. next time you revert, if the file size has changed, and the
new file size is
greater than some arbitrary value [e.g. 1 megabyte], do what we
regularly do.
otherwise:
3. create a temporary buffer.
4. disable change hooks in the buffer, e.g. bind them to nil.
5. do all the regular revert-buffer stuff, up to but not including
after-revert-hook, but with the results going into the temp buffer.
6. compare to the original.
7. if no change, do nothing. otherwise, stop disabling the
change hooks, copy
the new buffer into the original, run the after-revert-hook.
8. if you want to optimize further, instead of just copying
figure out how much
text at the beginning and end haven't changed, and only copy the
middle section
that has changed. this might require c support.
insert-file-contents already
has code to do this kind of checking.
1 + 2 are only there as an optimization. deleting those steps
won't make things
any less safe but might temporarily use a large amount of memory
in a situation
where the optimization of 3 - 8 is unlikely to succeed.
Andy Piper wrote:
>
> > what are you trying to achieve? i explained how to optimize away
> > after-revert-hook and after-change-hook. this should eliminate
> > all slowness
> > you're complaining about.
>
> Ben,
>
> Please add some more words to your explanation so that it makes sense to
> lesser mortals like me.
>
> Thanks
>
> andy