3] keep in mind there are many revert-buffer hooks, some of which
explicitly
replace the normal operation of inserting the file. your patch
as is completely
runs over them. the only hook that you can [reasonably safely]
Good point. Since I am only trying to hit a sweet spot here I guess it
would be possible to only use the optimization if there were no hooks, it
was called non-interactively and there were no coding system changes in
place.
optimize away is
`after-revert-hook' [and possibly `before-revert-hook']. to make
your patch
safe, it would have to do all the steps to actually revert the
buffer, but do it
in another buffer, and then finally compare the results and skip calling
`after-revert-hook' if they're the same. if semantic hooks off of
`after-revert-hook' [which it probably does], you're in luck.
with a bit of
effort you can also avoid having the before/after-change functions called.
I don't really understand this. Things like font-lock don't use
after-revert-hook, they use after-change-functions don't they? So how would
this work?
I still think we are actually missing a function, something like
`refresh-buffer', since revert-buffer is too fierce. Maybe
find-file-noselect is a better place for this?
andy
andy