* src/editfns.c (Freplace_buffer_contents): Add two optional arguments
for mitigating performance issues.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Move from
subr.el. Add the same two arguments as for replace-buffer-contents.
* lisp/json.el (json-pretty-print-max-secs): New variable holding the
default MAX-SECS value json-pretty-print passes to
replace-buffer-contents.
(json-pretty-print): Use it.
* doc/lispref/text.texi (Replacing): Add documentation for
replace-buffer-contents two new optional arguments. Document
replace-region-contents.