> An alternative is to go back to using replace-buffer-content. If its > default operation is (or could be) too slow, you should be able to > avoid that by passing zero for the MAX-SECS argument. > This is not a great solution. The point and mark will often move far away from where it was after replacing content, even inside a save-mark-and-incursion. There is a [RCS patch algorithm]( https://github.com/radian-software/apheleia/blob/main/apheleia-rcs.el) available in a third party package, but there's no built-in Emacs function that can do better than insert-file-contents in terms of speed and behavior.